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
78 avio_skip(pb, 4); /* Skip the XA ID */78 avio_skip(pb, 4); /* Skip the XA ID */
79 xa->out_size = avio_rl32(pb);79 xa->out_size = avio_rl32(pb);
80 avio_skip(pb, 2); /* Skip the tag */80 avio_skip(pb, 2); /* Skip the tag */
81 st->codecpar->channels = avio_rl16(pb);81 st->codecpar->ch_layout.nb_channels = avio_rl16(pb);
82 st->codecpar->sample_rate = avio_rl32(pb);82 st->codecpar->sample_rate = avio_rl32(pb);
83 avio_skip(pb, 4); /* Skip average byte rate */83 avio_skip(pb, 4); /* Skip average byte rate */
84 avio_skip(pb, 2); /* Skip block align */84 avio_skip(pb, 2); /* Skip block align */
85 avio_skip(pb, 2); /* Skip bits-per-sample */85 avio_skip(pb, 2); /* Skip bits-per-sample */
86 86
87 if (!st->codecpar->channels || !st->codecpar->sample_rate)87 if (!st->codecpar->ch_layout.nb_channels || !st->codecpar->sample_rate)
88 return AVERROR_INVALIDDATA;88 return AVERROR_INVALIDDATA;
89 89
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 *
91 st->codecpar->sample_rate / 28, 0, INT_MAX);91 st->codecpar->sample_rate / 28, 0, INT_MAX);
92 92
93 avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);93 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
108 if (xa->sent_bytes >= xa->out_size)108 if (xa->sent_bytes >= xa->out_size)
109 return AVERROR_EOF;109 return AVERROR_EOF;
110 /* 1 byte header and 14 bytes worth of samples * number channels per block */110 /* 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;
112 112
113 ret = av_get_packet(pb, pkt, packet_size);113 ret = av_get_packet(pb, pkt, packet_size);
114 if(ret < 0)114 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