From 8300609b78f70220b4d6c3c285070f0ca9fe5e3d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 25 Jul 2004 09:30:56 +0000 Subject: [PATCH] multi frame duplication fix Originally committed as revision 3338 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 0ab88d0..c7f1693 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -678,16 +678,16 @@ static void do_video_out(AVFormatContext *s, if (vdelta < -1.1) nb_frames = 0; else if (vdelta > 1.1) - nb_frames = 2; + nb_frames = lrintf(vdelta - 1.1 + 0.5); //fprintf(stderr, "vdelta:%f, ost->sync_opts:%lld, ost->sync_ipts:%f nb_frames:%d\n", vdelta, ost->sync_opts, ost->sync_ipts, nb_frames); if (nb_frames == 0){ ++nb_frames_drop; if (verbose>2) fprintf(stderr, "*** drop!\n"); - }else if (nb_frames == 2) { - ++nb_frames_dup; + }else if (nb_frames > 1) { + nb_frames_dup += nb_frames; if (verbose>2) - fprintf(stderr, "*** dup!\n"); + fprintf(stderr, "*** %d dup!\n", nb_frames-1); } }else ost->sync_opts= lrintf(ost->sync_ipts * enc->frame_rate / enc->frame_rate_base); -- 2.7.4