[vlc-commits] rawvideo: only init the date once

Steve Lhomme git at videolan.org
Fri Jul 21 13:26:10 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Jul 19 13:05:22 2017 +0200| [e36bd9a791444c53ec082da6ed4a6d22f37b8fcf] | committer: Jean-Baptiste Kempf

rawvideo: only init the date once

No need to do it with invalid values and then check it's valid.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/rawvideo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c
index 3db4c94d0b..9c5853bed6 100644
--- a/modules/codec/rawvideo.c
+++ b/modules/codec/rawvideo.c
@@ -103,8 +103,6 @@ static int OpenCommon( decoder_t *p_dec, bool b_packetizer )
     if ( !b_packetizer )
         es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
 
-    date_Init( &p_sys->pts, p_dec->fmt_out.video.i_frame_rate,
-               p_dec->fmt_out.video.i_frame_rate_base );
     if( p_dec->fmt_out.video.i_frame_rate == 0 ||
         p_dec->fmt_out.video.i_frame_rate_base == 0)
     {
@@ -113,6 +111,9 @@ static int OpenCommon( decoder_t *p_dec, bool b_packetizer )
                   p_dec->fmt_out.video.i_frame_rate_base);
         date_Init( &p_sys->pts, 25, 1 );
     }
+    else
+        date_Init( &p_sys->pts, p_dec->fmt_out.video.i_frame_rate,
+                    p_dec->fmt_out.video.i_frame_rate_base );
 
     for( unsigned i = 0; i < dsc->plane_count; i++ )
     {



More information about the vlc-commits mailing list