From 363673fbe0e182b96556f933d47e223eb477badb Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue, 10 Nov 2015 22:53:30 +0100
Subject: [PATCH] ffmpeg: Print a warning if a pkt duration is already set
 before using the frame rate

I didnt find any case that triggers this but if it gets triggered it needs to be
investigated

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 ffmpeg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index ae782700232..438175b5867 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -673,6 +673,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
         }
 
         if (ost->frame_rate.num && ost->is_cfr) {
+            if (pkt->duration > 0)
+                av_log(NULL, AV_LOG_WARNING, "Overriding packet duration by frame rate, this should not happen\n");
             pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
                                          ost->st->time_base);
         }
-- 
GitLab