[vlc-devel] [PATCH 06/11] decoder: don't check picture/block date against preroll if there's no preroll
Steve Lhomme
robux4 at ycbcr.xyz
Fri Aug 30 07:55:43 CEST 2019
---
src/input/decoder.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index cd940c4f15..f808c1cf51 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -977,7 +977,6 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
{
decoder_t *p_dec = &p_owner->dec;
vout_thread_t *p_vout = p_owner->p_vout;
- bool prerolled;
if( p_picture->date == VLC_TICK_INVALID )
{
@@ -987,14 +986,14 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
}
vlc_mutex_lock( &p_owner->lock );
- if( p_owner->i_preroll_end > p_picture->date )
+ bool prerolled = p_owner->i_preroll_end != (vlc_tick_t)INT64_MIN;
+ if( prerolled && p_owner->i_preroll_end > p_picture->date )
{
vlc_mutex_unlock( &p_owner->lock );
picture_Release( p_picture );
return VLC_EGENERIC;
}
- prerolled = p_owner->i_preroll_end > (vlc_tick_t)INT64_MIN;
p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
vlc_mutex_unlock( &p_owner->lock );
@@ -1122,7 +1121,6 @@ static void DecoderQueueThumbnail( decoder_t *p_dec, picture_t *p_pic )
static int DecoderPlayAudio( struct decoder_owner *p_owner, block_t *p_audio )
{
decoder_t *p_dec = &p_owner->dec;
- bool prerolled;
assert( p_audio != NULL );
@@ -1134,14 +1132,14 @@ static int DecoderPlayAudio( struct decoder_owner *p_owner, block_t *p_audio )
}
vlc_mutex_lock( &p_owner->lock );
- if( p_owner->i_preroll_end > p_audio->i_pts )
+ bool prerolled = p_owner->i_preroll_end != (vlc_tick_t)INT64_MIN;
+ if( prerolled && p_owner->i_preroll_end > p_audio->i_pts )
{
vlc_mutex_unlock( &p_owner->lock );
block_Release( p_audio );
return VLC_EGENERIC;
}
- prerolled = p_owner->i_preroll_end > (vlc_tick_t)INT64_MIN;
p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
vlc_mutex_unlock( &p_owner->lock );
--
2.17.1
More information about the vlc-devel
mailing list