[FFmpeg-devel] [PATCH] FFplay speedup if stepping whilst paused

Stefano Sabatini stefano.sabatini-lala
Sun Aug 26 11:45:22 CEST 2007


On date Friday 2007-08-03 15:43:20 +0200, Michael Niedermayer encoded:
> Hi
> 
> On Fri, Aug 03, 2007 at 11:18:17AM +0100, Craig Nicol wrote:
> > On 8/2/07, Michael Niedermayer <michaelni at gmx.at> wrote:
> > > Hi
> > >
> > > On Thu, Aug 02, 2007 at 11:39:52AM +0100, Craig Nicol wrote:
> > > > I've been writing a drift-correction program based on ffplay.c, but I've
> > > > discovered a problem in the original ffplay code that is still in the latest
> > > > SVN I've only tested this under Windows (MinGW), but given the patch that
> > > > fixes it below, I assume this is common to all platforms. The problem should
> > > > be repeatable by:
> > > >
> > > > 1. Open a video file in ffplay (I've used MPEG and an AVI recorded from
> > > > SecondLife)
> > > > 2. Pause the playing video by pressing space (or press s, which also causes
> > > > a pause)
> > > > 3. Step forward a frame by pressing s
> > > > 4. Wait a few seconds
> > > > 5. Unpause the video by pressing space
> > > >
> > > > Expected Behaviour:
> > > > Video should continue at normal speed.
> > > >
> > > > Actual Behaviour:
> > > > Video speeds up to catch-up with the 'lost' few seconds.
> > > >
> > > > The audio stream appears to pause and restart correctly. I have not tested
> > > > this on videos with subtitles.
> > > >
> > > > Patch behaviour:
> > > > Uses the existing stream_pause() function within the step frame code to
> > > > maintain the correct state whether paused using 's' or the space key.
> > > >
> > > > Suggested commit message:
> > > > Corrected pause handling when using the 's' step by frame key.
> > > > --
> > > > skype: callto:craignicol     sip:craignicol at ekiga.net
> > >
> > > > Index: ffplay.c
> > > > ===================================================================
> > > > --- ffplay.c  (revision 9868)
> > > > +++ ffplay.c  (working copy)
> > > > @@ -2213,7 +2213,7 @@
> > > >  {
> > > >      if (cur_stream) {
> > > >          if (cur_stream->paused)
> > > > -            cur_stream->paused=0;
> > > > +            stream_pause(cur_stream);
> > > >          cur_stream->video_current_pts = get_video_clock(cur_stream);
> > >
> > > shouldnt the
> > > cur_stream->video_current_pts=  ...
> > > be removed ?
> > >
> > I didn't remove it in the code I'm working with, and it works
> > properly. What behaviour would you expect to change if that line was
> > removed?
> 
> none, thats why i think it should be removed :)

Since Craig does not seem to come back with a new patch I've done
that.

I simply removed the line:
cur_stream->video_current_pts = get_video_clock(cur_stream);

since that is already done in stream_pause(), as suggested by Michael.

BTW the patch should be attributed anyway to Craig in the commit
message.

Cheers.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffplayspeedup-01.patch
Type: text/x-diff
Size: 523 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070826/54ae586b/attachment.patch>



More information about the ffmpeg-devel mailing list