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>
This commit is contained in:
Michael Niedermayer 2015-11-10 22:53:30 +01:00
parent 46070cc20a
commit 363673fbe0
1 changed files with 2 additions and 0 deletions

View File

@ -673,6 +673,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
} }
if (ost->frame_rate.num && ost->is_cfr) { 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), pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
ost->st->time_base); ost->st->time_base);
} }