diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-15 01:40:37 +0300 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-15 01:40:37 +0300 |
commit | 811a0aa785569affda577888908c66526ee2d0d9 (patch) | |
tree | 05205bb97c7db775e9b1ed6d5b3f0a16b5a392ac /libavformat | |
parent | 31a25063492c2bf219a0a1baa2cf18dd080fe5d9 (diff) |
warn if dts < pcr which means TS is invalid
Originally committed as revision 16607 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegtsenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 77815d0949..6c31f6df51 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -539,6 +539,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, if (write_pcr) { // add 11, pcr references the last byte of program clock reference base pcr = ts->cur_pcr + (4+7)*8*90000LL / ts->mux_rate; + if (dts != AV_NOPTS_VALUE && dts < pcr) + av_log(s, AV_LOG_WARNING, "dts < pcr, TS is invalid\n"); *q++ = 7; /* AFC length */ *q++ = 0x10; /* flags: PCR present */ *q++ = pcr >> 25; |