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/qcp.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/qcp.c')
-rw-r--r-- | libavformat/qcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/qcp.c b/libavformat/qcp.c index b58ae33579..46eb0a9685 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -93,7 +93,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) avio_rb32(pb); // "RIFF" s->file_size = avio_rl32(pb) + 8; - avio_seek(pb, 8 + 4 + 1 + 1, SEEK_CUR); // "QLCMfmt " + chunk-size + major-version + minor-version + avio_skip(pb, 8 + 4 + 1 + 1); // "QLCMfmt " + chunk-size + major-version + minor-version st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->channels = 1; @@ -110,13 +110,13 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "Unknown codec GUID.\n"); return AVERROR_INVALIDDATA; } - avio_seek(pb, 2 + 80, SEEK_CUR); // codec-version + codec-name + avio_skip(pb, 2 + 80); // codec-version + codec-name st->codec->bit_rate = avio_rl16(pb); s->packet_size = avio_rl16(pb); - avio_seek(pb, 2, SEEK_CUR); // block-size + avio_skip(pb, 2); // block-size st->codec->sample_rate = avio_rl16(pb); - avio_seek(pb, 2, SEEK_CUR); // sample-size + avio_skip(pb, 2); // sample-size memset(c->rates_per_mode, -1, sizeof(c->rates_per_mode)); nb_rates = avio_rl32(pb); @@ -129,7 +129,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) } else c->rates_per_mode[mode] = size; } - avio_seek(pb, 16 - 2*nb_rates + 20, SEEK_CUR); // empty entries of rate-map-table + reserved + avio_skip(pb, 16 - 2*nb_rates + 20); // empty entries of rate-map-table + reserved return 0; } @@ -174,14 +174,14 @@ static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt) case MKTAG('v', 'r', 'a', 't'): if (avio_rl32(pb)) // var-rate-flag s->packet_size = 0; - avio_seek(pb, 4, SEEK_CUR); // size-in-packets + avio_skip(pb, 4); // size-in-packets break; case MKTAG('d', 'a', 't', 'a'): c->data_size = chunk_size; break; default: - avio_seek(pb, chunk_size, SEEK_CUR); + avio_skip(pb, chunk_size); } } return AVERROR_EOF; |