History

xa: convert to new channel layout API

Vittorio Giovara committed 9 years ago

Commit 1e5f4f81 parent 6ad44981 file · +4 −4Browse files

Unified · Split

libavformat/xa.c+4−4
@@ -78,16 +78,16 @@ static int xa_read_header(AVFormatContext *s) · 77 unmodified lines
7878 avio_skip(pb, 4); /* Skip the XA ID */
7979 xa->out_size = avio_rl32(pb);
8080 avio_skip(pb, 2); /* Skip the tag */
81− st->codecpar->channels = avio_rl16(pb);
81+ st->codecpar->ch_layout.nb_channels = avio_rl16(pb);
8282 st->codecpar->sample_rate = avio_rl32(pb);
8383 avio_skip(pb, 4); /* Skip average byte rate */
8484 avio_skip(pb, 2); /* Skip block align */
8585 avio_skip(pb, 2); /* Skip bits-per-sample */
8686
87− if (!st->codecpar->channels || !st->codecpar->sample_rate)
87+ if (!st->codecpar->ch_layout.nb_channels || !st->codecpar->sample_rate)
8888 return AVERROR_INVALIDDATA;
8989
90− st->codecpar->bit_rate = av_clip(15LL * st->codecpar->channels * 8 *
90+ st->codecpar->bit_rate = av_clip(15LL * st->codecpar->ch_layout.nb_channels * 8 *
9191 st->codecpar->sample_rate / 28, 0, INT_MAX);
9292
9393 avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
@@ -108,7 +108,7 @@ static int xa_read_packet(AVFormatContext *s, · 14 unmodified lines
108108 if (xa->sent_bytes >= xa->out_size)
109109 return AVERROR_EOF;
110110 /* 1 byte header and 14 bytes worth of samples * number channels per block */
111− packet_size = 15*st->codecpar->channels;
111+ packet_size = 15*st->codecpar->ch_layout.nb_channels;
112112
113113 ret = av_get_packet(pb, pkt, packet_size);
114114 if(ret < 0)

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