[MPlayer-dev-eng] [PATCH] demuxer_lavf mp_seek() problem
Kohn Emil Dan
emild at cs.technion.ac.il
Tue Jul 10 11:38:49 CEST 2007
Hello,
On Mon, 9 Jul 2007, Michael Niedermayer wrote:
> Hi
>
>> --- libmpdemux/demux_lavf.c (revision 23739)
>> +++ libmpdemux/demux_lavf.c (working copy)
>> @@ -142,6 +142,8 @@
>> pos += stream->end_pos;
>> else if(whence == SEEK_SET)
>> pos += stream->start_pos;
>> + else if(whence == AVSEEK_SIZE)
>> + return stream->end_pos;
>> else
>> return -1;
>
> this is missing a check for end_pos being valid
What kind of check do you want here? For streaming files, end_pos is set
to 0. This means that mp_seek() won't return -1 for whence==AVSEEKSIZE and
url_fsize() won't retry the call to mp_seek() with offset -1 and whence=2,
which causes the corruption.
Emil
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Democracy is the form of government in which you can choose your dictator
>
More information about the MPlayer-dev-eng
mailing list