[FFmpeg-devel] dv_read_seek over 2GB fix

Maksym Veremeyenko verem
Sat Jun 16 12:37:40 CEST 2007


Michael Niedermayer ?????:

>> Attached patch seems fix this bug.
> [...]
>> -    return url_fseek(&s->pb, offset, SEEK_SET);
>> +    return (url_fseek(&s->pb, offset, SEEK_SET) < (offset_t)0)?-1:0;
> 
> this is incorrect, as it kills the error code and just returns -1

What error code you are talking about? 'url_fseek' returns results of 
calling 'lseek' (in a case of file protocol) and in a case of error 
lseek returns (off_t)-1 and this value re-returned to av_seek_frame that 
do not care about error code - it's interesting only in sign of returned 
value from:

ret = s->iformat->read_seek(s, stream_index, timestamp, flags);

see part of av_seek_frame code:

--- skipped ---
     /* first, we try the format specific seek */
     if (s->iformat->read_seek)
         ret = s->iformat->read_seek(s, stream_index, timestamp, flags);
     else
         ret = -1;
     if (ret >= 0) {
         return 0;
     }
--- skipped ---

Please point, where returned "error code" is processed in 
'av_seek_frame' (all values less then zero is treated as error and there 
are no detalization of error code....). I look at 'avidec.c' and it uses 
the same method - return '-1' in a case of error.

Please be more verbose in rejecting of patches.

-- 
________________________________________
Maksym Veremeyenko





More information about the ffmpeg-devel mailing list