[FFmpeg-cvslog] r25512 - in trunk: libavformat/mpegenc.c tests/ref/lavf/mpg tests/ref/seek/lavf_mpg

michael subversion
Sat Oct 16 23:31:32 CEST 2010


Author: michael
Date: Sat Oct 16 23:31:31 2010
New Revision: 25512

Log:
Avoid negative SCR in mpeg ps muxer.
Fixes a scr issue reported with dvdauthor ([FFmpeg-user] FFMPEG encoded MPEG-2 video causes error in DVDAuthor)

Modified:
   trunk/libavformat/mpegenc.c
   trunk/tests/ref/lavf/mpg
   trunk/tests/ref/seek/lavf_mpg

Modified: trunk/libavformat/mpegenc.c
==============================================================================
--- trunk/libavformat/mpegenc.c	Sat Oct 16 23:31:16 2010	(r25511)
+++ trunk/libavformat/mpegenc.c	Sat Oct 16 23:31:31 2010	(r25512)
@@ -1162,11 +1162,13 @@ static int mpeg_mux_write_packet(AVForma
 
     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;
+    if(pts != AV_NOPTS_VALUE) pts += 2*preload;
+    if(dts != AV_NOPTS_VALUE){
+        if(!s->last_scr)
+            s->last_scr= dts + preload;
+        dts += 2*preload;
+    }
 
 //av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE);
     if (!stream->premux_packet)

Modified: trunk/tests/ref/lavf/mpg
==============================================================================
--- trunk/tests/ref/lavf/mpg	Sat Oct 16 23:31:16 2010	(r25511)
+++ trunk/tests/ref/lavf/mpg	Sat Oct 16 23:31:31 2010	(r25512)
@@ -1,3 +1,3 @@
-eed66277633e53724e58e3fca2709f41 *./tests/data/lavf/lavf.mpg
+dd60652c2193670abffb8c2a123a820e *./tests/data/lavf/lavf.mpg
 372736 ./tests/data/lavf/lavf.mpg
 ./tests/data/lavf/lavf.mpg CRC=0x2b39ed74

Modified: trunk/tests/ref/seek/lavf_mpg
==============================================================================
--- trunk/tests/ref/seek/lavf_mpg	Sat Oct 16 23:31:16 2010	(r25511)
+++ trunk/tests/ref/seek/lavf_mpg	Sat Oct 16 23:31:31 2010	(r25512)
@@ -1,53 +1,53 @@
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: 339968 size:   681
+ret: 0         st: 0 flags:0 dts: 1.880000 pts: 1.920000 pos: 327680 size: 12894
 ret: 0         st: 0 flags:0  ts: 0.788333
-ret: 0         st: 1 flags:1 dts: 0.761222 pts: 0.761222 pos: 145408 size:   261
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 0 flags:1  ts:-0.317500
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: 370700 size:   235
+ret: 0         st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size:   235
 ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 1 flags:1 dts: 1.283678 pts: 1.283678 pos: 368652 size:   379
+ret: 0         st: 1 flags:1 dts: 1.261222 pts: 1.261222 pos: 145408 size:   261
 ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 0 flags:0  ts: 2.153333
-ret: 0         st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: 339968 size:   681
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size:   681
 ret: 0         st: 0 flags:1  ts: 1.047500
-ret: 0         st: 0 flags:0 dts: 1.020000 pts: 1.060000 pos: 212992 size: 16484
+ret: 0         st: 0 flags:0 dts: 1.040000 pts: 1.080000 pos:  40960 size: 16073
 ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: 370700 size:   235
+ret: 0         st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size:   235
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: 339968 size:   681
+ret: 0         st: 0 flags:0 dts: 1.760000 pts: 1.800000 pos: 292864 size: 13170
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:0 dts: 0.620000 pts: 0.660000 pos:  67584 size: 15804
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 0 flags:0  ts:-0.481667
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 0 flags:1  ts: 2.412500
-ret: 0         st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: 339968 size:   681
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size:   681
 ret: 0         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: 370700 size:   235
+ret: 0         st: 1 flags:1 dts: 1.522444 pts: 1.522444 pos: 342028 size:   314
 ret: 0         st: 1 flags:1  ts: 0.200844
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 1.420000 pts: 1.460000 pos: 339968 size:   681
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size:   681
 ret: 0         st: 0 flags:0  ts: 0.883344
-ret: 0         st: 0 flags:0 dts: 0.900000 pts: 0.940000 pos: 159744 size: 12809
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 0 flags:1  ts:-0.222489
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st: 1 flags:0  ts: 2.671678
-ret: 0         st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: 370700 size:   235
+ret: 0         st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size:   235
 ret: 0         st: 1 flags:1  ts: 1.565844
-ret: 0         st: 1 flags:1 dts: 1.518778 pts: 1.518778 pos: 370700 size:   235
+ret: 0         st: 1 flags:1 dts: 1.522444 pts: 1.522444 pos: 342028 size:   314
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:0 dts: 0.500000 pts: 0.540000 pos:  26624 size: 16303
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208
 ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 1 flags:1 dts: 0.500000 pts: 0.500000 pos:   2048 size:   208
+ret: 0         st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos:   2048 size:   208



More information about the ffmpeg-cvslog mailing list