mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
gxf: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
f36e9b30b0
commit
92e9b6ab6d
@ -143,8 +143,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
|
||||
case 9:
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codecpar->codec_id = AV_CODEC_ID_PCM_S24LE;
|
||||
st->codecpar->channels = 1;
|
||||
st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
|
||||
st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
|
||||
st->codecpar->sample_rate = 48000;
|
||||
st->codecpar->bit_rate = 3 * 1 * 48000 * 8;
|
||||
st->codecpar->block_align = 3 * 1;
|
||||
@ -153,8 +152,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
|
||||
case 10:
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
|
||||
st->codecpar->channels = 1;
|
||||
st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
|
||||
st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
|
||||
st->codecpar->sample_rate = 48000;
|
||||
st->codecpar->bit_rate = 2 * 1 * 48000 * 8;
|
||||
st->codecpar->block_align = 2 * 1;
|
||||
@ -163,8 +161,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
|
||||
case 17:
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codecpar->codec_id = AV_CODEC_ID_AC3;
|
||||
st->codecpar->channels = 2;
|
||||
st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
|
||||
st->codecpar->sample_rate = 48000;
|
||||
break;
|
||||
case 26: /* AVCi50 / AVCi100 (AVC Intra) */
|
||||
|
@ -714,7 +714,7 @@ static int gxf_write_header(AVFormatContext *s)
|
||||
av_log(s, AV_LOG_ERROR, "only 48000hz sampling rate is allowed\n");
|
||||
return -1;
|
||||
}
|
||||
if (st->codecpar->channels != 1) {
|
||||
if (st->codecpar->ch_layout.nb_channels != 1) {
|
||||
av_log(s, AV_LOG_ERROR, "only mono tracks are allowed\n");
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user