-
-
Save anonymous/87ab302de9d78301cb58f1ba8e210513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int DecoderPrerollBlock( decoder_t * p_dec, | |
uint32_t i_flags, mtime_t i_pts, mtime_t i_pts_stop, void(*pf_prerolled)(decoder_t*) ) | |
{ | |
bool b_flag_preroll = i_flags & BLOCK_FLAG_PREROLL; | |
bool b_flag_forced = i_flags & BLOCK_FLAG_DISPLAY_FORCED; | |
if( b_flag_preroll && !b_flag_forced ) | |
return 1; | |
decoder_owner_sys_t * p_owner = p_dec->p_owner; | |
vlc_mutex_lock( &p_owner->lock ); | |
mtime_t i_preroll_end = p_owner->i_preroll_end; | |
if( i_preroll_end <= VLC_TS_INVALID ) | |
{ | |
vlc_mutex_unlock( &p_owner->lock ); | |
return 0; | |
} | |
if( i_pts < i_preroll_end && i_pts_stop < i_preroll_end ) | |
{ | |
vlc_mutex_unlock( &p_owner->lock ); | |
return !b_flag_forced; | |
} | |
p_owner->i_preroll_end = VLC_TS_INVALID; | |
if( pf_prerolled ) | |
pf_prerolled( p_dec ); | |
vlc_mutex_unlock( &p_owner->lock ); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int DecoderPrerollBlock( decoder_t * p_dec, | |
uint32_t i_flags, mtime_t i_pts, mtime_t i_pts_stop, void(*pf_prerolled)(decoder_t*) ) | |
{ | |
bool b_flag_preroll = i_flags & BLOCK_FLAG_PREROLL; | |
bool b_flag_forced = i_flags & BLOCK_FLAG_DISPLAY_FORCED; | |
if( b_flag_preroll && !b_flag_forced ) | |
return 1; | |
mtime_t i_preroll_end = input_DecoderGetPrerollEnd( p_dec ); | |
if( i_preroll_end <= VLC_TS_INVALID ) | |
return 0; | |
if( i_pts < i_preroll_end && i_pts_stop < i_preroll_end ) | |
return !b_flag_forced; | |
input_DecoderSetPrerollEnd( p_dec, VLC_TS_INVALID ); | |
if( pf_prerolled ) | |
pf_prerolled( p_dec ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment