no warning when packet duration is valid patch attached
From 789e9f0e93a246fd820401e6c298835bf40dc0c3 Mon Sep 17 00:00:00 2001 From: Muhammad Faiz <mfc...@gmail.com> Date: Sun, 15 Nov 2015 15:25:43 +0700 Subject: [PATCH] ffmpeg: fix overriding packet duration warning
no warning when packet duration is valid --- ffmpeg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 3341777..5b9e38e 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -673,10 +673,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) } if (ost->frame_rate.num && ost->is_cfr) { - if (pkt->duration > 0) + int64_t new_duration = av_rescale_q(1, av_inv_q(ost->frame_rate), + ost->st->time_base); + if (pkt->duration > 0 && pkt->duration != new_duration) 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); + pkt->duration = new_duration; } } -- 1.8.3.1
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel