Commit af78a5f4 authored by bcoudurier's avatar bcoudurier

warn if dts < pcr which means TS is invalid

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16607 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 32fca657
...@@ -539,6 +539,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, ...@@ -539,6 +539,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
if (write_pcr) { if (write_pcr) {
// add 11, pcr references the last byte of program clock reference base // add 11, pcr references the last byte of program clock reference base
pcr = ts->cur_pcr + (4+7)*8*90000LL / ts->mux_rate; 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++ = 7; /* AFC length */
*q++ = 0x10; /* flags: PCR present */ *q++ = 0x10; /* flags: PCR present */
*q++ = pcr >> 25; *q++ = pcr >> 25;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment