Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
fa0629f9
Commit
fa0629f9
authored
Feb 04, 2016
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vpx: refactor error handling
parent
d86c1a12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
modules/codec/vpx.c
modules/codec/vpx.c
+14
-7
No files found.
modules/codec/vpx.c
View file @
fa0629f9
...
@@ -53,6 +53,18 @@ vlc_module_begin ()
...
@@ -53,6 +53,18 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_INPUT_VCODEC
)
set_subcategory
(
SUBCAT_INPUT_VCODEC
)
vlc_module_end
()
vlc_module_end
()
static
void
vpx_err_msg
(
vlc_object_t
*
this
,
struct
vpx_codec_ctx
*
ctx
,
const
char
*
msg
)
{
const
char
*
error
=
vpx_codec_error
(
ctx
);
const
char
*
detail
=
vpx_codec_error_detail
(
ctx
);
if
(
!
detail
)
detail
=
"no specific information"
;
msg_Err
(
this
,
msg
,
error
,
detail
);
}
#define VPX_ERR(this, ctx, msg) vpx_err_msg(VLC_OBJECT(this), ctx, msg)
/*****************************************************************************
/*****************************************************************************
* decoder_sys_t: libvpx decoder descriptor
* decoder_sys_t: libvpx decoder descriptor
*****************************************************************************/
*****************************************************************************/
...
@@ -95,11 +107,7 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
...
@@ -95,11 +107,7 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
if
(
err
!=
VPX_CODEC_OK
)
{
if
(
err
!=
VPX_CODEC_OK
)
{
free
(
pkt_pts
);
free
(
pkt_pts
);
const
char
*
error
=
vpx_codec_error
(
ctx
);
VPX_ERR
(
dec
,
ctx
,
"Failed to decode frame: %s (%s)"
);
const
char
*
detail
=
vpx_codec_error_detail
(
ctx
);
if
(
!
detail
)
detail
=
"no specific information"
;
msg_Err
(
dec
,
"Failed to decode frame: %s (%s)"
,
error
,
detail
);
return
NULL
;
return
NULL
;
}
}
...
@@ -191,8 +199,7 @@ static int OpenDecoder(vlc_object_t *p_this)
...
@@ -191,8 +199,7 @@ static int OpenDecoder(vlc_object_t *p_this)
vp_version
,
vpx_codec_version_str
(),
vpx_codec_build_config
());
vp_version
,
vpx_codec_version_str
(),
vpx_codec_build_config
());
if
(
vpx_codec_dec_init
(
&
sys
->
ctx
,
iface
,
&
deccfg
,
0
)
!=
VPX_CODEC_OK
)
{
if
(
vpx_codec_dec_init
(
&
sys
->
ctx
,
iface
,
&
deccfg
,
0
)
!=
VPX_CODEC_OK
)
{
const
char
*
error
=
vpx_codec_error
(
&
sys
->
ctx
);
VPX_ERR
(
p_this
,
&
sys
->
ctx
,
"Failed to initialize decoder: %s (%s)"
);
msg_Err
(
p_this
,
"Failed to initialize decoder: %s
\n
"
,
error
);
free
(
sys
);
free
(
sys
);
return
VLC_EGENERIC
;;
return
VLC_EGENERIC
;;
}
}
...
...
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