[vlc-devel] [PATCH 4/8] decoder: check missing audio block dates early

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 27 07:27:15 CEST 2019


Especially before we check this date against the i_preroll_end.
---
 src/input/decoder.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 419505e4f4..c0aa53f04d 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1134,6 +1134,13 @@ static bool DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio )
 
     assert( p_audio != NULL );
 
+    if( p_audio->i_pts == VLC_TICK_INVALID ) // FIXME --VLC_TICK_INVALID verify audio_output/*
+    {
+        msg_Warn( p_dec, "non-dated audio buffer received" );
+        block_Release( p_audio );
+        return true;
+    }
+
     vlc_mutex_lock( &p_owner->lock );
     if( p_owner->i_preroll_end > p_audio->i_pts )
     {
@@ -1155,13 +1162,6 @@ static bool DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio )
     }
 
     /* */
-    if( p_audio->i_pts == VLC_TICK_INVALID ) // FIXME --VLC_TICK_INVALID verify audio_output/*
-    {
-        msg_Warn( p_dec, "non-dated audio buffer received" );
-        block_Release( p_audio );
-        return true;
-    }
-
     /* */
     vlc_mutex_lock( &p_owner->lock );
     if( p_owner->b_waiting )
-- 
2.17.1



More information about the vlc-devel mailing list