dash: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
release/5.1
Vittorio Giovara 8 years ago committed by James Almer
parent 3b3b8eb8ef
commit e4fc86a458
  1. 2
      libavformat/dashenc.c
  2. 3
      libavformat/dauddec.c
  3. 2
      libavformat/daudenc.c

@ -859,7 +859,7 @@ static int write_adaptation_set(AVFormatContext *s, AVIOContext *out, int as_ind
avio_printf(out, "\t\t\t<Representation id=\"%d\" mimeType=\"audio/%s\" codecs=\"%s\"%s audioSamplingRate=\"%d\">\n",
i, os->format_name, os->codec_str, bandwidth_str, s->streams[i]->codecpar->sample_rate);
avio_printf(out, "\t\t\t\t<AudioChannelConfiguration schemeIdUri=\"urn:mpeg:dash:23003:3:audio_channel_configuration:2011\" value=\"%d\" />\n",
s->streams[i]->codecpar->channels);
s->streams[i]->codecpar->ch_layout.nb_channels);
}
if (!final && c->write_prft && os->producer_reference_time_str[0]) {
avio_printf(out, "\t\t\t\t<ProducerReferenceTime id=\"%d\" inband=\"true\" type=\"%s\" wallClockTime=\"%s\" presentationTime=\"%"PRId64"\">\n",

@ -29,8 +29,7 @@ static int daud_header(AVFormatContext *s) {
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = AV_CODEC_ID_PCM_S24DAUD;
st->codecpar->codec_tag = MKTAG('d', 'a', 'u', 'd');
st->codecpar->channels = 6;
st->codecpar->channel_layout = AV_CH_LAYOUT_5POINT1;
st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1;
st->codecpar->sample_rate = 96000;
st->codecpar->bit_rate = 3 * 6 * 96000 * 8;
st->codecpar->block_align = 3 * 6;

@ -24,7 +24,7 @@
static int daud_init(struct AVFormatContext *s)
{
AVCodecParameters *par = s->streams[0]->codecpar;
if (par->channels!=6 || par->sample_rate!=96000)
if (par->ch_layout.nb_channels != 6 || par->sample_rate != 96000)
return AVERROR(EINVAL);
return 0;
}

Loading…
Cancel
Save