[vlc-commits] vout: add still frame state

Francois Cartegnie git at videolan.org
Fri Nov 16 09:27:07 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 15 22:03:39 2018 +0100| [1ec1fb37f3a50ab4376aa5fbae18e417ea895ce4] | committer: Francois Cartegnie

vout: add still frame state

still frames after a discontinuity must not
be revoked by previously sent pts

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

 include/vlc_picture.h         | 1 +
 modules/codec/avcodec/video.c | 2 ++
 src/input/decoder.c           | 5 +++++
 src/misc/picture.c            | 2 ++
 4 files changed, 10 insertions(+)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index 6aca13bca0..0f34cbb7d4 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -91,6 +91,7 @@ struct picture_t
     /**@{*/
     vlc_tick_t      date;                                  /**< display date */
     bool            b_force;
+    bool            b_still;
     /**@}*/
 
     /** \name Picture dynamic properties
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 4f5fde5e5f..50cae13171 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1305,6 +1305,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         /* Send decoded frame to vout */
         if (i_pts != VLC_TICK_INVALID)
         {
+            if(p_frame_info->b_eos)
+                p_pic->b_still = true;
             p_sys->b_first_frame = false;
             decoder_QueueVideo( p_dec, p_pic );
         }
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 5ce154678e..da83cf1b9f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1151,6 +1151,11 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
             vout_Flush( p_vout, p_picture->date );
             p_owner->i_last_rate = i_rate;
         }
+        else 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
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 90c6bd7c8d..7da1a07035 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -93,6 +93,7 @@ void picture_Reset( picture_t *p_picture )
     /* */
     p_picture->date = VLC_TICK_INVALID;
     p_picture->b_force = false;
+    p_picture->b_still = false;
     p_picture->b_progressive = false;
     p_picture->i_nb_fields = 2;
     p_picture->b_top_field_first = false;
@@ -387,6 +388,7 @@ void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
 {
     p_dst->date = p_src->date;
     p_dst->b_force = p_src->b_force;
+    p_dst->b_still = p_src->b_still;
 
     p_dst->b_progressive = p_src->b_progressive;
     p_dst->i_nb_fields = p_src->i_nb_fields;



More information about the vlc-commits mailing list