From 5541759f6fabccb5067da158fbb7458fb96b0155 Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Wed, 14 Jan 2009 22:17:07 +0000 Subject: [PATCH] only write dts if they differ from pts, according to specs Originally committed as revision 16605 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mpegtsenc.c | 4 ++-- tests/libav.regression.ref | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 82b8d88fb..77815d094 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -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; } diff --git a/tests/libav.regression.ref b/tests/libav.regression.ref index d97a52cc1..a7c4bcb9d 100644 --- a/tests/libav.regression.ref +++ b/tests/libav.regression.ref @@ -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 -- 2.11.0