MPEG seek crash (was: [Ffmpeg-devel] Re: Compiling FFmpeg using ISO/C89 compiler)

Guillaume POIRIER poirierg
Fri Dec 8 11:45:58 CET 2006


Hi,

(quoting the relevant parts of he old mpeg-2 crash thread)

On 12/8/06, Diego Biurrun <diego at biurrun.de> wrote:

> This issue is now buried in an old and long-forgotten thread.  Please
> submit a new bug report along with the sample and clear steps to
> reproduce the problem.

Steve wrote:

> So the problem is dynamic. You need to read/decode frames before seeking
> for the crash to occur. That's why only trying with ffplay produces the
> crash. And only after modifying it (since it's dynamic it's almost
> impossible to seek to the location where you want it to crash).

Steve wrote:

> OK, I only added the possibility in ffplay to seek by bytes instead of
> time. Now you can play chems1.vob, seek back a few times and it will
> crash (on MinGW at least). It doesn't with our custom patch that was
> discussed a long time ago as a non valid/clean solution.
>
> $ ./ffplay.exe -bytes /C/test/DivX/chems1.vob

Michael wrote:
date		Nov 6, 2006 7:10 PM	
subject		Re: [Ffmpeg-devel] [Bad news]: MPEG Seek has failed to work
in FFmpeg SVN

> looks ok with one exception

[...]

> looks ok with one exception
>
>
> [...]
> > -                incr = -10.0;
> > +                if (seek_by_bytes)
> > +                    incr = 1861818;
> > +                else
> > +                    incr = -10.0;
> >                  goto do_seek;
> >              case SDLK_RIGHT:
> > -                incr = 10.0;
> > +                if (seek_by_bytes)
> > +                    incr = 1861818;
> > +                else
> > +                    incr = 10.0;
> >                  goto do_seek;
> >              case SDLK_UP:
> > -                incr = 60.0;
> > +                if (seek_by_bytes)
> > +                    incr = 8861818;
> > +                else
> > +                    incr = 60.0;
> >                  goto do_seek;
> >              case SDLK_DOWN:
> > -                incr = -60.0;
> > +                if (seek_by_bytes)
> > +                    incr = -8861818;
> > +                else
> > +                    incr = -60.0;
> >              do_seek:
> >                  if (cur_stream) {
> > -                    pos = get_master_clock(cur_stream);
> > -                    pos += incr;
> > -                    stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), incr);
> > +                    if (seek_by_bytes) {
> > +                        pos = url_ftell(&cur_stream->ic->pb);
> > +                        pos += incr;
> > +                        stream_seek(cur_stream, pos, incr);
> > +                    } else {
> > +                        pos = get_master_clock(cur_stream);
> > +                        pos += incr;
> > +                        stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), incr);
> > +                    }
>
> the above should rather set incr like it did and then muliply that by
> AVFormatContext.bit_rate, if not zero if 0 then some default

(about the patch named ffplay-seek_by_bytes.patch)

So Steve, please resend your patch as an attachment with Michael's
comments addressed and I'll commit it.

Guillaume
-- 
An association of men who will not quarrel with one another is a thing
which has never yet existed, from the greatest confederacy of nations
down to a town meeting or a vestry.
 -- Thomas Jefferson
(when interviewed about MPlayer ML flamewars)
http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html




More information about the ffmpeg-devel mailing list