]> git.sesse.net Git - vlc/commitdiff
* mpegvideo.c: try to set a better value for length. (I am not sure it is
authorLaurent Aimar <fenrir@videolan.org>
Sun, 10 Aug 2003 22:13:05 +0000 (22:13 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 10 Aug 2003 22:13:05 +0000 (22:13 +0000)
 the good one but it give far better result). dts/pts/length computation
 should be verified.

modules/packetizer/mpegvideo.c

index bab30bf8abf4e96c7661f8b5238922315f78fc76..548bbaa11c3ecac2ad4332f91924b87ffbce7951 100644 (file)
@@ -2,7 +2,7 @@
  * mpegvideo.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mpegvideo.c,v 1.15 2003/06/10 22:42:59 gbazin Exp $
+ * $Id: mpegvideo.c,v 1.16 2003/08/10 22:13:05 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -510,15 +510,21 @@ static void PacketizeThread( packetizer_t *p_pack )
     {
         /* Trivial case (DTS == PTS) */
         p_pack->i_interpolated_dts += i_duration;
+        p_sout_buffer->i_length = i_duration;
     }
     else
     {
         p_pack->i_interpolated_dts += p_pack->i_old_duration;
+        p_sout_buffer->i_length = p_pack->i_old_duration;
         p_pack->i_old_duration = i_duration;
     }
 
     p_sout_buffer->i_bitrate = (int)( 8 * i_pos * p_pack->d_frame_rate );
-    p_sout_buffer->i_length = i_duration;
+#if 0
+    msg_Dbg( p_pack->p_fifo, "------------> dts=%lld pts=%lld duration=%lld",
+             p_sout_buffer->i_dts, p_sout_buffer->i_pts,
+             p_sout_buffer->i_length );
+#endif
 
     sout_InputSendBuffer( p_pack->p_sout_input, p_sout_buffer );
 }