[FFmpeg-devel] [PATCH 2/2] ffmpeg: Print a warning if a pkt duration is already set before using the frame rate

Michael Niedermayer michaelni at gmx.at
Tue Nov 10 22:53:30 CET 2015


From: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/ffmpeg.c b/ffmpeg.c
index ae78270..438175b 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);
         }
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list