summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-07-25 09:30:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-07-25 09:30:56 +0000
commit8300609b78f70220b4d6c3c285070f0ca9fe5e3d (patch)
tree76055582fa7d3b823c134e870036146413d1f156
parenta9aeda81e72fdc7c457645b231b7b05040944517 (diff)
downloadffmpeg-streaming-8300609b78f70220b4d6c3c285070f0ca9fe5e3d.zip
ffmpeg-streaming-8300609b78f70220b4d6c3c285070f0ca9fe5e3d.tar.gz
multi frame duplication fix
Originally committed as revision 3338 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c8
1 files 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);
OpenPOWER on IntegriCloud