Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
6515e283
Commit
6515e283
authored
Sep 25, 2017
by
Aman Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/videotoolbox: print descriptive errors on decode failures
Signed-off-by:
Aman Gupta
<
aman@tmm1.net
>
parent
d869928c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
videotoolbox.c
libavcodec/videotoolbox.c
+16
-4
No files found.
libavcodec/videotoolbox.c
View file @
6515e283
...
@@ -572,9 +572,22 @@ static OSStatus videotoolbox_session_decode_frame(AVCodecContext *avctx)
...
@@ -572,9 +572,22 @@ static OSStatus videotoolbox_session_decode_frame(AVCodecContext *avctx)
return
status
;
return
status
;
}
}
static
const
char
*
videotoolbox_error_string
(
OSStatus
status
)
{
switch
(
status
)
{
case
kVTVideoDecoderBadDataErr
:
return
"bad data"
;
case
kVTVideoDecoderMalfunctionErr
:
return
"decoder malfunction"
;
case
kVTInvalidSessionErr
:
return
"invalid session"
;
}
return
"unknown"
;
}
static
int
videotoolbox_common_end_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
)
static
int
videotoolbox_common_end_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
)
{
{
int
status
;
OSStatus
status
;
AVVideotoolboxContext
*
videotoolbox
=
videotoolbox_get_context
(
avctx
);
AVVideotoolboxContext
*
videotoolbox
=
videotoolbox_get_context
(
avctx
);
VTContext
*
vtctx
=
avctx
->
internal
->
hwaccel_priv_data
;
VTContext
*
vtctx
=
avctx
->
internal
->
hwaccel_priv_data
;
...
@@ -582,9 +595,8 @@ static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)
...
@@ -582,9 +595,8 @@ static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
status
=
videotoolbox_session_decode_frame
(
avctx
);
status
=
videotoolbox_session_decode_frame
(
avctx
);
if
(
status
!=
noErr
)
{
if
(
status
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to decode frame (%s, %d)
\n
"
,
videotoolbox_error_string
(
status
),
(
int
)
status
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to decode frame (%d)
\n
"
,
status
);
return
AVERROR_UNKNOWN
;
return
AVERROR_UNKNOWN
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment