[FFmpeg-devel] [PATCH 2/3] lavf: replace all uses of url_fskip with avio_seek
Ronald S. Bultje
rsbultje
Wed Mar 2 14:11:48 CET 2011
Hi,
On Wed, Mar 2, 2011 at 8:01 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Feb 28, 2011 at 02:57:55PM +0100, Anton Khirnov wrote:
> [...]
>> diff --git a/libavformat/aea.c b/libavformat/aea.c
>> index 8316a7e..60b2d38 100644
>> --- a/libavformat/aea.c
>> +++ b/libavformat/aea.c
>> @@ -62,9 +62,9 @@ static int aea_read_header(AVFormatContext *s,
>> ? ? ? ? ?return AVERROR(ENOMEM);
>>
>> ? ? ?/* Parse the amount of channels and skip to pos 2048(0x800) */
>> - ? ?url_fskip(s->pb, 264);
>> + ? ?avio_seek(s->pb, 264, SEEK_CUR);
>> ? ? ?st->codec->channels = avio_r8(s->pb);
>> - ? ?url_fskip(s->pb, 1783);
>> + ? ?avio_seek(s->pb, 1783, SEEK_CUR);
>
> another worsening of the API
How?
We have two functions (seek(SEEK_CUR) and skip) that do the same
thing. Why not merge them together, optimize that correctly for the
corner cases where possible (data is in buffer, etc.), and otherwise
drop the other?
We considered avio_skip() as a macro for avio_seek(SEEK_CUR), but
Anton preferred this variant because it was clearer to the API user
what was going on. It's his patch, therefore he decides.
Lastly, this was discussed repeatedly on IRC and here and the patch
was on the ML for probably a week. Please speak up earlier next time,
this in-hindsight stuff is a little, well, too late.
Ronald
More information about the ffmpeg-devel
mailing list