[vlc-commits] decoder: remove always true boolean

Steve Lhomme git at videolan.org
Tue Sep 3 10:12:24 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 27 07:25:34 2019 +0200| [d19d234b943f93dfffcea6f1f33dd8591eadefd3] | committer: Steve Lhomme

decoder: remove always true boolean

The VLC_TICK_INVALID check is done early. After that we don't need to check it
anymore.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d19d234b943f93dfffcea6f1f33dd8591eadefd3
---

 src/input/decoder.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 3f063ad019..b37d8b1c22 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1025,8 +1025,6 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
         p_picture->b_force = true;
     }
 
-    const bool b_dated = p_picture->date != VLC_TICK_INVALID;
-
     vlc_mutex_unlock( &p_owner->lock );
 
     /* FIXME: The *input* FIFO should not be locked here. This will not work
@@ -1040,24 +1038,12 @@ static int DecoderPlayVideo( struct decoder_owner *p_owner, picture_t *p_picture
     if( p_vout == NULL )
         goto discard;
 
-    if( p_picture->b_force || p_picture->date != VLC_TICK_INVALID )
-        /* FIXME: VLC_TICK_INVALID -- verify video_output */
+    if( p_picture->b_still )
     {
-        if( p_picture->b_still )
-        {
-            /* Ensure no earlier higher pts breaks still state */
-            vout_Flush( p_vout, p_picture->date );
-        }
-        vout_PutPicture( p_vout, p_picture );
-    }
-    else
-    {
-        if( b_dated )
-            msg_Warn( p_dec, "early picture skipped" );
-        else
-            msg_Warn( p_dec, "non-dated video buffer received" );
-        goto discard;
+        /* Ensure no earlier higher pts breaks still state */
+        vout_Flush( p_vout, p_picture->date );
     }
+    vout_PutPicture( p_vout, p_picture );
 
     return VLC_SUCCESS;
 discard:



More information about the vlc-commits mailing list