diff mbox series

[FFmpeg-devel,v3,4/4] fftools/ffmpeg: Ignore dts checking for AV_DISPOSITION_URGENT

Message ID 20210717023829.84846-4-xqq@xqq.im
State New
Headers show
Series [FFmpeg-devel,v3,1/4] avformat: Introduce AV_DISPOSITION_URGENT disposition flag for emergency alert
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

zheng qian July 17, 2021, 2:38 a.m. UTC
Stream with AV_DISPOSITION_URGENT disposition flag could be NOPTS.

Signed-off-by: zheng qian <xqq@xqq.im>
---
 fftools/ffmpeg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 1ac2e48600..a3b720748b 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -824,7 +824,8 @@  static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
         if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) &&
             pkt->dts != AV_NOPTS_VALUE &&
             !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
-            ost->last_mux_dts != AV_NOPTS_VALUE) {
+            ost->last_mux_dts != AV_NOPTS_VALUE &&
+            !(st->disposition & AV_DISPOSITION_URGENT)) {
             int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
             if (pkt->dts < max) {
                 int loglevel = max - pkt->dts > 2 || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? AV_LOG_WARNING : AV_LOG_DEBUG;