[MPlayer-dev-eng] [PATCH] support AVSEEK_SIZE for demux_lavf.c

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Mon Aug 20 00:49:24 CEST 2007


On Sunday, 19 August 2007 at 23:28, Reimar Döffinger wrote:
> Hello,
> does this patch look right to you?
> And I also think that the whence == SEEK_END case should check for
> stream->end_pos being valid (i.e. > 0), okay to apply such a change as
> well?
> 
> Index: libmpdemux/demux_lavf.c
> ===================================================================
> --- libmpdemux/demux_lavf.c     (revision 24102)
> +++ libmpdemux/demux_lavf.c     (working copy)
> @@ -145,6 +145,8 @@
>          pos += stream->end_pos;
>      else if(whence == SEEK_SET)
>          pos += stream->start_pos;
> +    else if(whence == AVSEEK_SIZE && stream->end_pos > 0)
> +        return stream->end_pos - stream->start_pos;
>      else
>          return -1;
>  

This fixes the problem with cache enabled that we've talked about on IRC
for me. Thanks.

Regards,
R.

-- 
MPlayer developer and RPMs maintainer: http://mplayerhq.hu http://rpm.livna.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan



More information about the MPlayer-dev-eng mailing list