[SCM] libav/experimental: Init SCR in mpeg muxer based on first DTS. This fixes issues if the first DTS is far away from 0.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:17:11 UTC 2013


The following commit has been merged in the experimental branch:
commit 9b272e327495dcb7110ea4c746adeda09765e099
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Thu Oct 7 00:32:22 2010 +0000

    Init SCR in mpeg muxer based on first DTS.
    This fixes issues if the first DTS is far away from 0.
    
    Originally committed as revision 25383 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index b37a774..f94b9fa 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1160,6 +1160,8 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
 
     pts= pkt->pts;
     dts= pkt->dts;
+    if(!s->last_scr)
+        s->last_scr= dts;
 
     if(pts != AV_NOPTS_VALUE) pts += preload;
     if(dts != AV_NOPTS_VALUE) dts += preload;
diff --git a/tests/ref/lavf/mpg b/tests/ref/lavf/mpg
index 9b1664f..2f5b3a7 100644
--- a/tests/ref/lavf/mpg
+++ b/tests/ref/lavf/mpg
@@ -1,3 +1,3 @@
-e36a005ecca9add8bda6e0655d03716f *./tests/data/lavf/lavf.mpg
+eed66277633e53724e58e3fca2709f41 *./tests/data/lavf/lavf.mpg
 372736 ./tests/data/lavf/lavf.mpg
 ./tests/data/lavf/lavf.mpg CRC=0x2b39ed74

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list