Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Steve Lhomme
VLC
Commits
c85147a4
Commit
c85147a4
authored
6 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
include: do not issue assertions in external plug-ins
parent
90b79191
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/vlc_codec.h
+24
-17
24 additions, 17 deletions
include/vlc_codec.h
include/vlc_common.h
+20
-1
20 additions, 1 deletion
include/vlc_common.h
include/vlc_picture.h
+1
-1
1 addition, 1 deletion
include/vlc_picture.h
with
45 additions
and
19 deletions
include/vlc_codec.h
+
24
−
17
View file @
c85147a4
...
...
@@ -271,7 +271,8 @@ struct encoder_t
VLC_USED
static
inline
int
decoder_UpdateVideoFormat
(
decoder_t
*
dec
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
if
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
->
video
.
format_update
!=
NULL
)
return
dec
->
cbs
->
video
.
format_update
(
dec
);
else
...
...
@@ -298,7 +299,7 @@ static inline int decoder_UpdateVideoFormat( decoder_t *dec )
VLC_USED
static
inline
picture_t
*
decoder_NewPicture
(
decoder_t
*
dec
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
return
dec
->
cbs
->
video
.
buffer_new
(
dec
);
}
...
...
@@ -321,9 +322,9 @@ VLC_API void decoder_AbortPictures( decoder_t *dec, bool b_abort );
*/
static
inline
void
decoder_QueueVideo
(
decoder_t
*
dec
,
picture_t
*
p_pic
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
assert
(
p_pic
->
p_next
==
NULL
);
assert
(
dec
->
cbs
->
video
.
queue
!=
NULL
);
vlc_
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_
assert
(
p_pic
->
p_next
==
NULL
);
vlc_
assert
(
dec
->
cbs
->
video
.
queue
!=
NULL
);
dec
->
cbs
->
video
.
queue
(
dec
,
p_pic
);
}
...
...
@@ -337,7 +338,8 @@ static inline void decoder_QueueVideo( decoder_t *dec, picture_t *p_pic )
static
inline
void
decoder_QueueCc
(
decoder_t
*
dec
,
block_t
*
p_cc
,
const
decoder_cc_desc_t
*
p_desc
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
if
(
dec
->
cbs
->
video
.
queue_cc
==
NULL
)
block_Release
(
p_cc
);
else
...
...
@@ -353,9 +355,9 @@ static inline void decoder_QueueCc( decoder_t *dec, block_t *p_cc,
*/
static
inline
void
decoder_QueueAudio
(
decoder_t
*
dec
,
block_t
*
p_aout_buf
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
AUDIO_ES
&&
dec
->
cbs
!=
NULL
);
assert
(
p_aout_buf
->
p_next
==
NULL
);
assert
(
dec
->
cbs
->
audio
.
queue
!=
NULL
);
vlc_
assert
(
dec
->
fmt_in
.
i_cat
==
AUDIO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_
assert
(
p_aout_buf
->
p_next
==
NULL
);
vlc_
assert
(
dec
->
cbs
->
audio
.
queue
!=
NULL
);
dec
->
cbs
->
audio
.
queue
(
dec
,
p_aout_buf
);
}
...
...
@@ -368,9 +370,9 @@ static inline void decoder_QueueAudio( decoder_t *dec, block_t *p_aout_buf )
*/
static
inline
void
decoder_QueueSub
(
decoder_t
*
dec
,
subpicture_t
*
p_spu
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
SPU_ES
&&
dec
->
cbs
!=
NULL
);
assert
(
p_spu
->
p_next
==
NULL
);
assert
(
dec
->
cbs
->
spu
.
queue
!=
NULL
);
vlc_
assert
(
dec
->
fmt_in
.
i_cat
==
SPU_ES
&&
dec
->
cbs
!=
NULL
);
vlc_
assert
(
p_spu
->
p_next
==
NULL
);
vlc_
assert
(
dec
->
cbs
->
spu
.
queue
!=
NULL
);
dec
->
cbs
->
spu
.
queue
(
dec
,
p_spu
);
}
...
...
@@ -382,7 +384,8 @@ static inline void decoder_QueueSub( decoder_t *dec, subpicture_t *p_spu )
VLC_USED
static
inline
int
decoder_UpdateAudioFormat
(
decoder_t
*
dec
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
AUDIO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
AUDIO_ES
&&
dec
->
cbs
!=
NULL
);
if
(
dec
->
fmt_in
.
i_cat
==
AUDIO_ES
&&
dec
->
cbs
->
audio
.
format_update
!=
NULL
)
return
dec
->
cbs
->
audio
.
format_update
(
dec
);
else
...
...
@@ -405,7 +408,8 @@ VLC_USED
static
inline
subpicture_t
*
decoder_NewSubpicture
(
decoder_t
*
dec
,
const
subpicture_updater_t
*
p_dyn
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
SPU_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
SPU_ES
&&
dec
->
cbs
!=
NULL
);
subpicture_t
*
p_subpicture
=
dec
->
cbs
->
spu
.
buffer_new
(
dec
,
p_dyn
);
if
(
!
p_subpicture
)
msg_Warn
(
dec
,
"can't get output subpicture"
);
...
...
@@ -421,7 +425,8 @@ static inline int decoder_GetInputAttachments( decoder_t *dec,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
)
{
assert
(
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
cbs
!=
NULL
);
if
(
!
dec
->
cbs
->
get_attachments
)
return
VLC_EGENERIC
;
...
...
@@ -436,7 +441,8 @@ static inline int decoder_GetInputAttachments( decoder_t *dec,
VLC_USED
static
inline
vlc_tick_t
decoder_GetDisplayDate
(
decoder_t
*
dec
,
vlc_tick_t
i_ts
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
if
(
!
dec
->
cbs
->
video
.
get_display_date
)
return
VLC_TS_INVALID
;
...
...
@@ -450,7 +456,8 @@ static inline vlc_tick_t decoder_GetDisplayDate( decoder_t *dec, vlc_tick_t i_ts
VLC_USED
static
inline
float
decoder_GetDisplayRate
(
decoder_t
*
dec
)
{
assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
vlc_assert
(
dec
->
fmt_in
.
i_cat
==
VIDEO_ES
&&
dec
->
cbs
!=
NULL
);
if
(
!
dec
->
cbs
->
video
.
get_display_rate
)
return
1
.
f
;
...
...
This diff is collapsed.
Click to expand it.
include/vlc_common.h
+
20
−
1
View file @
c85147a4
...
...
@@ -246,7 +246,26 @@
* If the branch is reached in a non-debug build, this macro is equivalent to
* \ref unreachable and the behaviour is undefined.
*/
#define vlc_assert_unreachable() (assert(!"unreachable"), unreachable())
#define vlc_assert_unreachable() (vlc_assert(!"unreachable"), unreachable())
/**
* Run-time assertion
*
* This macro performs a run-time assertion if C assertions are enabled
* and the following preprocessor symbol is defined:
* @verbatim __LIBVLC__ @endverbatim
* That restriction ensures that assertions in public header files are not
* unwittingly <i>leaked</i> to externally-compiled plug-ins
* including those header files.
*
* Within the LibVLC code base, this is exactly the same as assert(), which can
* and probably should be used directly instead.
*/
#ifdef __LIBVLC__
# define vlc_assert(pred) assert(pred)
#else
# define vlc_assert(pred) ((void)0)
#endif
/* Linkage */
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
include/vlc_picture.h
+
1
−
1
View file @
c85147a4
...
...
@@ -263,7 +263,7 @@ enum
*/
static
inline
void
picture_SwapUV
(
picture_t
*
picture
)
{
assert
(
picture
->
i_planes
==
3
);
vlc_
assert
(
picture
->
i_planes
==
3
);
plane_t
tmp_plane
=
picture
->
p
[
U_PLANE
];
picture
->
p
[
U_PLANE
]
=
picture
->
p
[
V_PLANE
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment