Mercurial > libavformat.hg
changeset 4214:5720e5948e0b libavformat
warn if dts < pcr which means TS is invalid
author | bcoudurier |
---|---|
date | Wed, 14 Jan 2009 22:40:37 +0000 |
parents | 461f23728a14 |
children | f7321bb14421 |
files | mpegtsenc.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegtsenc.c Wed Jan 14 22:17:07 2009 +0000 +++ b/mpegtsenc.c Wed Jan 14 22:40:37 2009 +0000 @@ -539,6 +539,8 @@ 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;