diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-03-15 09:14:38 +0100 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-03-16 22:24:51 -0400 |
commit | 45a8a02a4151c9ff0d1161bf90bffcfbbb312fb8 (patch) | |
tree | 79beacdc9d6d90d0e31558526d83033200f4361d /libavformat/iff.c | |
parent | cbf5d22d24945e52b3c1e4c1a00d4d8179be930a (diff) | |
download | ffmpeg-45a8a02a4151c9ff0d1161bf90bffcfbbb312fb8.tar.gz |
lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r-- | libavformat/iff.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c index 3e329343a4..900d823d2b 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -134,7 +134,7 @@ static int iff_read_header(AVFormatContext *s, return AVERROR(ENOMEM); st->codec->channels = 1; - avio_seek(pb, 8, SEEK_CUR); + avio_skip(pb, 8); // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content st->codec->codec_tag = avio_rl32(pb); @@ -152,10 +152,10 @@ static int iff_read_header(AVFormatContext *s, if (data_size < 14) return AVERROR_INVALIDDATA; - avio_seek(pb, 12, SEEK_CUR); + avio_skip(pb, 12); st->codec->sample_rate = avio_rb16(pb); if (data_size >= 16) { - avio_seek(pb, 1, SEEK_CUR); + avio_skip(pb, 1); compression = avio_r8(pb); } break; @@ -186,14 +186,14 @@ static int iff_read_header(AVFormatContext *s, return AVERROR_INVALIDDATA; st->codec->width = avio_rb16(pb); st->codec->height = avio_rb16(pb); - avio_seek(pb, 4, SEEK_CUR); // x, y offset + avio_skip(pb, 4); // x, y offset st->codec->bits_per_coded_sample = avio_r8(pb); if (data_size >= 11) { - avio_seek(pb, 1, SEEK_CUR); // masking + avio_skip(pb, 1); // masking compression = avio_r8(pb); } if (data_size >= 16) { - avio_seek(pb, 3, SEEK_CUR); // paddding, transparent + avio_skip(pb, 3); // paddding, transparent st->sample_aspect_ratio.num = avio_r8(pb); st->sample_aspect_ratio.den = avio_r8(pb); } @@ -223,7 +223,7 @@ static int iff_read_header(AVFormatContext *s, return res; } } - avio_seek(pb, data_size - (avio_tell(pb) - orig_pos) + (data_size & 1), SEEK_CUR); + avio_skip(pb, data_size - (avio_tell(pb) - orig_pos) + (data_size & 1)); } avio_seek(pb, iff->body_pos, SEEK_SET); |