bsfc = bsfc->next;
}
- if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
+ if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
+ if(
(avctx->codec_type == AVMEDIA_TYPE_AUDIO || avctx->codec_type == AVMEDIA_TYPE_VIDEO) &&
pkt->dts != AV_NOPTS_VALUE &&
ost->last_mux_dts != AV_NOPTS_VALUE) {
pkt->pts = FFMAX(pkt->pts, max);
pkt->dts = max;
}
+ }
+ if (pkt->dts != AV_NOPTS_VALUE &&
+ pkt->pts != AV_NOPTS_VALUE &&
+ pkt->dts > pkt->pts) {
+ av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d\n",
+ pkt->dts, pkt->pts,
+ ost->file_index, ost->st->index);
+ pkt->pts = AV_NOPTS_VALUE;
+ pkt->dts = AV_NOPTS_VALUE;
+ }
}
ost->last_mux_dts = pkt->dts;