only write dts if they differ from pts, according to specs
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Wed, 14 Jan 2009 22:17:07 +0000 (22:17 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Wed, 14 Jan 2009 22:17:07 +0000 (22:17 +0000)
Originally committed as revision 16605 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mpegtsenc.c
tests/libav.regression.ref

index 82b8d88..77815d0 100644 (file)
@@ -576,7 +576,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
                 header_len += 5;
                 flags |= 0x80;
             }
-            if (dts != AV_NOPTS_VALUE) {
+            if (dts != AV_NOPTS_VALUE && dts != pts) {
                 header_len += 5;
                 flags |= 0x40;
             }
@@ -609,7 +609,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
                 write_pts(q, flags >> 6, pts);
                 q += 5;
             }
-            if (dts != AV_NOPTS_VALUE) {
+            if (dts != AV_NOPTS_VALUE && dts != pts) {
                 write_pts(q, 1, dts);
                 q += 5;
             }
index d97a52c..a7c4bcb 100644 (file)
@@ -9,8 +9,8 @@ c351132527ccb1e8cab06cc0822fde23 *./tests/data/b-libav.rm
 bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg
 378880 ./tests/data/b-libav.mpg
 ./tests/data/b-libav.mpg CRC=0x2b71a386
-9fd96456cbf2a550da816e563316d92f *./tests/data/b-libav.ts
-471692 ./tests/data/b-libav.ts
+676a06e0f0f6639f5199efd52fec9ca9 *./tests/data/b-libav.ts
+471316 ./tests/data/b-libav.ts
 ./tests/data/b-libav.ts CRC=0xcc4948e1
 1b28a16652bb8ac528b33f7478ca18b6 *./tests/data/b-libav.swf
 335771 ./tests/data/b-libav.swf