[MPlayer-dev-eng] [PATCH] demuxer_lavf mp_seek() problem

Michael Niedermayer michaelni at gmx.at
Tue Jul 10 13:18:07 CEST 2007


Hi

On Tue, Jul 10, 2007 at 12:38:49PM +0300, Kohn Emil Dan wrote:
> 
> 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.

AVSEEK_SIZE MUST return -1 or another error code (<0) if the size is not known
0 means the size is 0 and is not a valid error code

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070710/7dbc6d2b/attachment.pgp>


More information about the MPlayer-dev-eng mailing list