diff mbox series

[FFmpeg-devel] lavf/mux: ignore nonmonotonic timestamps for timestampless muxers

Message ID 20221122000810.42699-1-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel] lavf/mux: ignore nonmonotonic timestamps for timestampless muxers | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

rcombs Nov. 22, 2022, 12:08 a.m. UTC
---
 libavformat/mux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 37fe19358d..7b13dd8012 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -538,7 +538,7 @@  static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *
     }
 
     if (sti->cur_dts && sti->cur_dts != AV_NOPTS_VALUE &&
-        ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) &&
+        ((!(s->oformat->flags & (AVFMT_TS_NONSTRICT | AVFMT_NOTIMESTAMPS)) &&
           st->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE &&
           st->codecpar->codec_type != AVMEDIA_TYPE_DATA &&
           sti->cur_dts >= pkt->dts) || sti->cur_dts > pkt->dts)) {
@@ -783,7 +783,8 @@  static int prepare_input_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
         /* check that the dts are increasing (or at least non-decreasing,
          * if the format allows it */
         if (sti->cur_dts != AV_NOPTS_VALUE &&
-            ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) && sti->cur_dts >= pkt->dts) ||
+            ((!(s->oformat->flags & (AVFMT_TS_NONSTRICT | AVFMT_NOTIMESTAMPS)) &&
+              sti->cur_dts >= pkt->dts) ||
              sti->cur_dts > pkt->dts)) {
             av_log(s, AV_LOG_ERROR,
                    "Application provided invalid, non monotonically increasing "