[FFmpeg-devel] [PATCH 3/3] ffplay: increase maximum frame duration to 1 hour

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 25 22:14:05 CET 2012


On Sun, Nov 25, 2012 at 10:06:41PM +0100, Michael Niedermayer wrote:
> On Sun, Nov 25, 2012 at 08:01:23PM +0100, Marton Balint wrote:
> > Partially fixes ticket #1707. A-V sync still needs some work after seeking...
> > 
> > Signed-off-by: Marton Balint <cus at passwd.hu>
> > ---
> >  ffplay.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/ffplay.c b/ffplay.c
> > index a3bda0e..c0f0c30 100644
> > --- a/ffplay.c
> > +++ b/ffplay.c
> > @@ -1318,7 +1318,7 @@ retry:
> >  
> >              /* compute nominal last_duration */
> >              last_duration = vp->pts - is->frame_last_pts;
> > -            if (last_duration > 0 && last_duration < 10.0) {
> > +            if (last_duration > 0 && last_duration < 3600.0) {
> >                  /* if duration of the last frame was sane, update last_duration in video state */
> >                  is->frame_last_duration = last_duration;
> >              }
> 
> This may need a check for AVFMT_TS_DISCONT
> because 1h differences in containers with AVFMT_TS_DISCONT are likely
> not frame durations but rather discontinuities. while for other
> containers they may be frame durations

While you can discuss if that is the best method, MPlayer looks at the
audio PTS, if it didn't/doesn't jump it's likely the video duration
probably is that long.
One of the advantages is that it can work with long durations even
for formats with AVFMT_TS_DISCONT, the disadvantage is that behaviour
suddenly changes when the audio stream is disabled...


More information about the ffmpeg-devel mailing list