summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorBryan Huh <bryan@box.com>2015-11-14 18:26:30 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-16 01:53:47 +0100
commit1fe82abac7ecc072b83644dcd89678b50d69d23a (patch)
treef1a052b8951f714a400c328c514f94ea75a222c7 /ffmpeg.c
parentdfa98c4f839ea8bc447f370f97840977447a41c0 (diff)
downloadffmpeg-1fe82abac7ecc072b83644dcd89678b50d69d23a.tar.gz
ffmpeg: Simplify fps code related to delta0
Small refactor of fps code for improved readability. In particular the "cor" variable was unnecessary and misleading because it would always be set to -delta0. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index a56ec870ca..c4e9280f86 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1013,20 +1013,19 @@ static void do_video_out(AVFormatContext *s,
delta > 0 &&
format_video_sync != VSYNC_PASSTHROUGH &&
format_video_sync != VSYNC_DROP) {
- double cor = FFMIN(-delta0, duration);
if (delta0 < -0.6) {
av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", -delta0);
} else
av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0);
- sync_ipts += cor;
- duration -= cor;
- delta0 += cor;
+ sync_ipts = ost->sync_opts;
+ duration += delta0;
+ delta0 = 0;
}
switch (format_video_sync) {
case VSYNC_VSCFR:
- if (ost->frame_number == 0 && delta - duration >= 0.5) {
- av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta - duration));
+ if (ost->frame_number == 0 && delta0 >= 0.5) {
+ av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0));
delta = duration;
delta0 = 0;
ost->sync_opts = lrint(sync_ipts);