]> git.sesse.net Git - vlc/commitdiff
libmpeg2: Don't spam the log on bitrate changes in VBR streams
authorMarian Ďurkovič <md@bts.sk>
Sat, 19 Sep 2009 06:08:05 +0000 (08:08 +0200)
committerMarian Ďurkovič <md@bts.sk>
Sat, 19 Sep 2009 06:08:05 +0000 (08:08 +0200)
modules/codec/libmpeg2.c

index f3b2dec57e525ae5d181306bf30d0b6fd96ac5c8..e88f28331d6dd09d021b2dd68aa0de883a8f678a 100644 (file)
@@ -172,6 +172,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->i_previous_pts = 0;
     p_sys->i_current_dts  = 0;
     p_sys->i_previous_dts = 0;
+    p_sys->i_aspect = 0;
     p_sys->b_garbage_pic = false;
     p_sys->b_slice_i  = false;
     p_sys->b_second_field = false;
@@ -711,6 +712,7 @@ static block_t *GetCc( decoder_t *p_dec, bool pb_present[4] )
 static void GetAR( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
+    int i_old_aspect = p_sys->i_aspect;
 
     /* Check whether the input gave a particular aspect ratio */
     if( p_dec->fmt_in.video.i_aspect )
@@ -742,6 +744,9 @@ static void GetAR( decoder_t *p_dec )
         }
     }
 
+    if( p_sys->i_aspect == i_old_aspect )
+        return;
+
     if( p_sys->p_info->sequence->frame_period > 0 )
         msg_Dbg( p_dec,
                  "%dx%d (display %d,%d), aspect %d, sar %i:%i, %u.%03u fps",