[FFmpeg-devel] [PATCH 2/3] lavf: replace all uses of url_fskip with avio_seek
Michael Niedermayer
michaelni
Wed Mar 2 14:01:06 CET 2011
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
and
egrep '(url_fseek.*SEEK_CUR|url_fskip)' *.c | wc -l
380
grep url_fseek *.c | grep -v SEEK_CUR|wc -l
265
Its the most common case that is worsened, all other cases together are fewer
simply add a prefix to *skip() and fix the return value, no need to make the
API more complex
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/46472395/attachment.pgp>
More information about the ffmpeg-devel
mailing list