[Ffmpeg-devel] [Bad news]: MPEG Seek has failed to work in FFmpeg SVN

Michael Niedermayer michaelni
Mon Nov 6 19:10:03 CET 2006


Hi

On Mon, Nov 06, 2006 at 06:59:50PM +0100, Steve Lhomme wrote:
> Diego Biurrun wrote:
> >On Mon, Nov 06, 2006 at 05:58:52PM +0100, Steve Lhomme 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
> >
> >Forgot to attach the patch?
> 
> What patch ?
> ;)

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

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list