History

avformat/avr: Combine skips

Andreas Rheinhardt committed 2 years ago

Commit cdff5a21 parent 56ba83f1 file · +3 −9Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/avr.c+3−9
@@ -49,8 +49,7 @@ static int avr_read_header(AVFormatContext *s) · 48 unmodified lines
49 49
50 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;50 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
51 51
52 avio_skip(s->pb, 4); // magic52 avio_skip(s->pb, 4 /* magic */ + 8 /* sample_name */);
53 avio_skip(s->pb, 8); // sample_name
54 53
55 chan = avio_rb16(s->pb);54 chan = avio_rb16(s->pb);
56 if (!chan) {55 if (!chan) {
@@ -66,18 +65,13 @@ static int avr_read_header(AVFormatContext *s) · 9 unmodified lines
66 65
67 sign = avio_rb16(s->pb);66 sign = avio_rb16(s->pb);
68 67
69 avio_skip(s->pb, 2); // loop68 avio_skip(s->pb, 2 /* loop */ + 2 /* midi */ + 1 /* replay speed */);
70 avio_skip(s->pb, 2); // midi
71 avio_skip(s->pb, 1); // replay speed
72 69
73 st->codecpar->sample_rate = avio_rb24(s->pb);70 st->codecpar->sample_rate = avio_rb24(s->pb);
74 if (st->codecpar->sample_rate == 0)71 if (st->codecpar->sample_rate == 0)
75 return AVERROR_INVALIDDATA;72 return AVERROR_INVALIDDATA;
76 73
77 avio_skip(s->pb, 4 * 3);74 avio_skip(s->pb, 4 * 3 + 2 * 3 + 20 + 64);
78 avio_skip(s->pb, 2 * 3);
79 avio_skip(s->pb, 20);
80 avio_skip(s->pb, 64);
81 75
82 st->codecpar->codec_id = ff_get_pcm_codec_id(bps, 0, 1, sign);76 st->codecpar->codec_id = ff_get_pcm_codec_id(bps, 0, 1, sign);
83 if (st->codecpar->codec_id == AV_CODEC_ID_NONE) {77 if (st->codecpar->codec_id == AV_CODEC_ID_NONE) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t