[FFmpeg-devel] [PATCH 2/3] lavf: replace all uses of url_fskip with avio_seek

Michael Niedermayer michaelni
Wed Mar 2 14:29:19 CET 2011


On Wed, Mar 02, 2011 at 08:11:48AM -0500, Ronald S. Bultje wrote:
> 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?

1 argument more that is always the same


> 
> 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?

same reason as printf() vs. fprintf(stdout)
and  a+= b vs. a= a+b

the shorter form exists because it is very common and more readable.



> 
> 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.

unless you can read peoples minds, i dont think you can know what the API
users consider cleaner.

also, if its antons patch he decides
if its my patch (you remember last i send or even every i send since you
hijaked the repository) its suddenly your decission and not mine

as said, you are a dictator and a very dishonest one.

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110302/40e2098a/attachment.pgp>



More information about the ffmpeg-devel mailing list