diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-02-27 14:53:29 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-02-27 14:53:29 +0000 |
commit | e6fdc2b1a0def9aa77aac861ed151c7c2ccef413 (patch) | |
tree | dc8e4923be6ec650587f2845bd5d3024621e22d4 /ffmpeg.c | |
parent | fc6765d7194b7e82fd871f88e8938b430cf8a910 (diff) | |
download | ffmpeg-e6fdc2b1a0def9aa77aac861ed151c7c2ccef413.tar.gz |
Make sure -vsync 2 does not produce timestamps equal to the previous,
rather drop a frame.
Fixes Issue872.
Originally committed as revision 17643 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -865,9 +865,12 @@ static void do_video_out(AVFormatContext *s, //FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c if (vdelta < -1.1) nb_frames = 0; - else if (video_sync_method == 2 || (video_sync_method<0 && (s->oformat->flags & AVFMT_VARIABLE_FPS))) + else if (video_sync_method == 2 || (video_sync_method<0 && (s->oformat->flags & AVFMT_VARIABLE_FPS))){ + if(vdelta<=-0.6){ + nb_frames=0; + }else if(vdelta>0.6) ost->sync_opts= lrintf(get_sync_ipts(ost) / av_q2d(enc->time_base)); - else if (vdelta > 1.1) + }else if (vdelta > 1.1) nb_frames = lrintf(vdelta); //fprintf(stderr, "vdelta:%f, ost->sync_opts:%"PRId64", ost->sync_ipts:%f nb_frames:%d\n", vdelta, ost->sync_opts, get_sync_ipts(ost), nb_frames); if (nb_frames == 0){ |