diff mbox series

[FFmpeg-devel,045/281] dash: convert to new channel layout API

Message ID 20220113015101.4-46-jamrial@gmail.com
State Accepted
Commit e4fc86a45877faccff8ee73be76a20a720a85de7
Headers show
Series New channel layout API | expand

Commit Message

James Almer Jan. 13, 2022, 1:50 a.m. UTC
From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/dashenc.c | 2 +-
 libavformat/dauddec.c | 3 +--
 libavformat/daudenc.c | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

Comments

Anton Khirnov Jan. 26, 2022, 1:56 p.m. UTC | #1
Quoting James Almer (2022-01-13 02:50:07)
> From: Vittorio Giovara <vittorio.giovara@gmail.com>
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/dashenc.c | 2 +-
>  libavformat/dauddec.c | 3 +--
>  libavformat/daudenc.c | 2 +-

The latter two don't have anything to do with dash
diff mbox series

Patch

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 4709bc6615..9a97838f5c 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.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",
diff --git a/libavformat/dauddec.c b/libavformat/dauddec.c
index 6a5962c238..dbbd39a3b4 100644
--- a/libavformat/dauddec.c
+++ b/libavformat/dauddec.c
@@ -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;
diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 183a08ba30..2e252449e9 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -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;
 }