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

Steve Lhomme slhomme
Mon Nov 6 19:42:08 CET 2006


Michael Niedermayer wrote:
> 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

Yeah, I just put the actual size/location of where it crashes in 
chems1.vob in our app. Here's another patch with a more general value. 
(I made sure chems1.vob crashes too).

Steve

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffplay-seek_by_bytes.v2.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061106/b9b49432/attachment.txt>



More information about the ffmpeg-devel mailing list