avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
James Zern
2011-05-26 20:19:04 +02:00
committed by Justin Ruggles
parent 5d603f1b65
commit e9cef89702
11 changed files with 26 additions and 10 deletions

View File

@ -2962,7 +2962,9 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
pkt->dts= st->pts_buffer[0];
}
if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){
if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
((!(s->oformat->flags & AVFMT_TS_NONSTRICT) &&
st->cur_dts >= pkt->dts) || st->cur_dts > pkt->dts)) {
av_log(s, AV_LOG_ERROR,
"Application provided invalid, non monotonically increasing dts to muxer in stream %d: %"PRId64" >= %"PRId64"\n",
st->index, st->cur_dts, pkt->dts);