summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-10 22:53:29 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-11 15:04:21 +0100
commit46070cc20aa341d385136ec767b127a956f7d9ba (patch)
tree3309c3df45c6e7a10a1e2d3a5b28c28d93f6051e /ffmpeg.c
parent9ffc61b1256e42c54766e73fd899a57261eb9b3b (diff)
ffmpeg: set muxer packet duration based on framerate only for CFR
a set ost->frame_rate does not imply CFR in ffmpeg The changed fate tests had all wrong packet durations (like 1/1000 or 1/90000) There might be more cases in which is_cfr could be set Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 7f3c426e09..ae78270023 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -672,7 +672,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
ost->error[i] = -1;
}
- if (ost->frame_rate.num) {
+ if (ost->frame_rate.num && ost->is_cfr) {
pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
ost->st->time_base);
}
@@ -1005,6 +1005,7 @@ static void do_video_out(AVFormatContext *s,
format_video_sync = VSYNC_VSCFR;
}
}
+ ost->is_cfr = (format_video_sync == VSYNC_CFR || format_video_sync == VSYNC_VSCFR);
if (delta0 < 0 &&
delta > 0 &&