[FFmpeg-devel] [PATCH] fix av_url_read_fseek

Howard Chu hyc
Sun Apr 11 01:37:36 CEST 2010


Michael Niedermayer wrote:
> On Sat, Apr 10, 2010 at 09:26:31AM -0700, Howard Chu wrote:
>> Index: libavformat/aviobuf.c
>> ===================================================================
>> --- libavformat/aviobuf.c	(revision 22813)
>> +++ libavformat/aviobuf.c	(working copy)
>> @@ -698,8 +698,11 @@
>>           return AVERROR(ENOSYS);
>>       ret = s->read_seek(h, stream_index, timestamp, flags);
>>       if(ret>= 0) {
>> +        int64_t pos;
>>           s->buf_ptr = s->buf_end; // Flush buffer
>> -        s->pos = s->seek(h, 0, SEEK_CUR);
>> +        pos = s->seek(h, 0, SEEK_CUR);
>> +        if (pos != AVERROR(ENOSYS))
>> +            s->pos = pos;
>>       }
>>       return ret;
>>   }
>
> this should be a seperate patch

Protocols that implement read_seek are unlikely to also implement seek, so 
this patch is needed to prevent the pos from getting set to a negative value. 
Possibly it should just check for pos <= 0 instead of checking for any 
specific error code. It's not clear that there's any real point to calling 
seek here anyway, any stream that knows the value of SEEK_CUR would have 
already updated itself while executing the read_seek.
-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dif2.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100410/8535200d/attachment.txt>



More information about the ffmpeg-devel mailing list