Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks
@ 2024-07-17  1:49 James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 2/4] avformat/iamf_writer: fix PCM endian-ness flag James Almer
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: James Almer @ 2024-07-17  1:49 UTC (permalink / raw)
  To: ffmpeg-devel

From: Felicia Lim <flim@google.com>

Clause 6.2.3 of IAMF[1] states both of these shall be set to 0.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#iasampleentry-section
---
 libavformat/movenc.c                    | 15 +++++++++++++++
 tests/ref/fate/mov-mp4-iamf-5_1_4       |  2 +-
 tests/ref/fate/mov-mp4-iamf-7_1_4       |  2 +-
 tests/ref/fate/mov-mp4-iamf-ambisonic_1 |  2 +-
 tests/ref/fate/mov-mp4-iamf-stereo      |  2 +-
 5 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2bea55e33d..5de188f4cf 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1399,6 +1399,11 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
                 avio_wb16(pb, 16);
             avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
         } else { /* reserved for mp4/3gp */
+#if CONFIG_IAMFENC
+            if (track->tag == MKTAG('i','a','m','f'))
+                avio_wb16(pb, 0); /* channelcount must be 0 for IAMF */
+            else
+#endif
             avio_wb16(pb, track->par->ch_layout.nb_channels);
             if (track->par->codec_id == AV_CODEC_ID_FLAC ||
                 track->par->codec_id == AV_CODEC_ID_ALAC) {
@@ -1410,6 +1415,11 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
         }
 
         avio_wb16(pb, 0); /* packet size (= 0) */
+#if CONFIG_IAMFENC
+        if (track->tag == MKTAG('i','a','m','f'))
+            avio_wb16(pb, 0); /* samplerate must be 0 for IAMF */
+        else
+#endif
         if (track->par->codec_id == AV_CODEC_ID_OPUS)
             avio_wb16(pb, 48000);
         else if (track->par->codec_id == AV_CODEC_ID_TRUEHD)
@@ -5158,6 +5168,11 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
             param_write_int(pb, "AudioTag", ff_codec_get_tag(ff_codec_wav_tags,
                                                              track->par->codec_id));
             param_write_int(pb, "Channels", track->par->ch_layout.nb_channels);
+#if CONFIG_IAMFENC
+            if (track->tag == MKTAG('i','a','m','f'))
+                param_write_int(pb, "SamplingRate", 0);
+            else
+#endif
             param_write_int(pb, "SamplingRate", track->par->sample_rate);
             param_write_int(pb, "BitsPerSample", 16);
             param_write_int(pb, "PacketSize", track->par->block_align ?
diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 b/tests/ref/fate/mov-mp4-iamf-5_1_4
index afaa620621..36106528ab 100644
--- a/tests/ref/fate/mov-mp4-iamf-5_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-5_1_4
@@ -1,4 +1,4 @@
-5585ed23481b6f28437b3707a1ed632d *tests/data/fate/mov-mp4-iamf-5_1_4.mp4
+0316d0a483480ccd582fd20f06c77420 *tests/data/fate/mov-mp4-iamf-5_1_4.mp4
 86340 tests/data/fate/mov-mp4-iamf-5_1_4.mp4
 #extradata 0:       34, 0xafa70d5e
 #extradata 1:       34, 0xafa70d5e
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4 b/tests/ref/fate/mov-mp4-iamf-7_1_4
index e8b859121d..51494222fc 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4
@@ -1,4 +1,4 @@
-690d2b7a15b5489c59a9148fcd7975be *tests/data/fate/mov-mp4-iamf-7_1_4.mp4
+d9ef5d14bbd37c5a06c1494cacdb8f29 *tests/data/fate/mov-mp4-iamf-7_1_4.mp4
 100588 tests/data/fate/mov-mp4-iamf-7_1_4.mp4
 #extradata 0:       34, 0xafa70d5e
 #extradata 1:       34, 0xafa70d5e
diff --git a/tests/ref/fate/mov-mp4-iamf-ambisonic_1 b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
index 8de90c868f..d0877f73c7 100644
--- a/tests/ref/fate/mov-mp4-iamf-ambisonic_1
+++ b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
@@ -1,4 +1,4 @@
-2b3517591f7bf20e0f74f3ec1381af1e *tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
+b0f4accdb8f1f3dfe594a6cbd6c00603 *tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
 57743 tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
 #extradata 0:       34, 0xad120cfe
 #extradata 1:       34, 0xad120cfe
diff --git a/tests/ref/fate/mov-mp4-iamf-stereo b/tests/ref/fate/mov-mp4-iamf-stereo
index 32027e6daf..e40d164fc4 100644
--- a/tests/ref/fate/mov-mp4-iamf-stereo
+++ b/tests/ref/fate/mov-mp4-iamf-stereo
@@ -1,4 +1,4 @@
-88c2b547f069f2d4a11d24f7f922251a *tests/data/fate/mov-mp4-iamf-stereo.mp4
+87c17d1a9fd07e16c369d386d39c3249 *tests/data/fate/mov-mp4-iamf-stereo.mp4
 15163 tests/data/fate/mov-mp4-iamf-stereo.mp4
 #extradata 0:       34, 0xafa70d5e
 #tb 0: 1/44100
-- 
2.45.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [FFmpeg-devel] [PATCH 2/4] avformat/iamf_writer: fix PCM endian-ness flag
  2024-07-17  1:49 [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks James Almer
@ 2024-07-17  1:49 ` James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 3/4] avformat/iamf_writer: fix coded audio_roll_distance values James Almer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: James Almer @ 2024-07-17  1:49 UTC (permalink / raw)
  To: ffmpeg-devel

From: Felicia Lim <flim@google.com>

The value was swapped from what's defined in clause 3.11.4 of IAMF[1]

[1]https://aomediacodec.github.io/iamf/#lpcm-specific
---
 libavformat/iamf_writer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 6d4e4082eb..35db078147 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -441,32 +441,32 @@ static int iamf_write_codec_config(const IAMFContext *iamf,
         avio_write(dyn_bc, codec_config->extradata, codec_config->extradata_size);
         break;
     case AV_CODEC_ID_PCM_S16LE:
-        avio_w8(dyn_bc, 0);
+        avio_w8(dyn_bc, 1);
         avio_w8(dyn_bc, 16);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
     case AV_CODEC_ID_PCM_S24LE:
-        avio_w8(dyn_bc, 0);
+        avio_w8(dyn_bc, 1);
         avio_w8(dyn_bc, 24);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
     case AV_CODEC_ID_PCM_S32LE:
-        avio_w8(dyn_bc, 0);
+        avio_w8(dyn_bc, 1);
         avio_w8(dyn_bc, 32);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
     case AV_CODEC_ID_PCM_S16BE:
-        avio_w8(dyn_bc, 1);
+        avio_w8(dyn_bc, 0);
         avio_w8(dyn_bc, 16);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
     case AV_CODEC_ID_PCM_S24BE:
-        avio_w8(dyn_bc, 1);
+        avio_w8(dyn_bc, 0);
         avio_w8(dyn_bc, 24);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
     case AV_CODEC_ID_PCM_S32BE:
-        avio_w8(dyn_bc, 1);
+        avio_w8(dyn_bc, 0);
         avio_w8(dyn_bc, 32);
         avio_wb32(dyn_bc, codec_config->sample_rate);
         break;
-- 
2.45.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [FFmpeg-devel] [PATCH 3/4] avformat/iamf_writer: fix coded audio_roll_distance values
  2024-07-17  1:49 [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 2/4] avformat/iamf_writer: fix PCM endian-ness flag James Almer
@ 2024-07-17  1:49 ` James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 4/4] avformat/iamf: byteswap values in OpusHeader James Almer
  2024-07-17  6:18 ` [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks Anton Khirnov
  3 siblings, 0 replies; 6+ messages in thread
From: James Almer @ 2024-07-17  1:49 UTC (permalink / raw)
  To: ffmpeg-devel

From: Felicia Lim <flim@google.com>

'seek_preroll' corresponds to 'audio_roll_distance' in IAMF[]1

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#audio_roll_distance
---
 libavformat/iamf_parse.c  |  2 +-
 libavformat/iamf_writer.c | 30 +++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index a69d4a2f3a..2674a5186d 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -683,7 +683,7 @@ static int audio_element_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
         substream->codecpar->codec_id   = codec_config->codec_id;
         substream->codecpar->frame_size = codec_config->nb_samples;
         substream->codecpar->sample_rate = codec_config->sample_rate;
-        substream->codecpar->seek_preroll = codec_config->seek_preroll;
+        substream->codecpar->seek_preroll = -codec_config->seek_preroll * codec_config->nb_samples;
 
         switch(substream->codecpar->codec_id) {
         case AV_CODEC_ID_AAC:
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 35db078147..af837ccb1f 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -72,6 +72,34 @@ static int update_extradata(IAMFCodecConfig *codec_config)
     return 0;
 }
 
+static int populate_default_seek_preroll(IAMFCodecConfig *codec_config)
+{
+    switch (codec_config->codec_id) {
+    case AV_CODEC_ID_OPUS:
+        if (!codec_config->nb_samples)
+            return AVERROR(EINVAL);
+        // ceil(3840 / nb_samples)
+        codec_config->seek_preroll = -(1 + ((3840 - 1) / codec_config->nb_samples));
+        break;
+    case AV_CODEC_ID_AAC:
+        codec_config->seek_preroll = -1;
+        break;
+    case AV_CODEC_ID_FLAC:
+    case AV_CODEC_ID_PCM_S16BE:
+    case AV_CODEC_ID_PCM_S24BE:
+    case AV_CODEC_ID_PCM_S32BE:
+    case AV_CODEC_ID_PCM_S16LE:
+    case AV_CODEC_ID_PCM_S24LE:
+    case AV_CODEC_ID_PCM_S32LE:
+        codec_config->seek_preroll = 0;
+        break;
+    default:
+        return AVERROR(EINVAL);
+    }
+
+    return 0;
+}
+
 static int fill_codec_config(IAMFContext *iamf, const AVStreamGroup *stg,
                              IAMFCodecConfig *codec_config)
 {
@@ -83,7 +111,7 @@ static int fill_codec_config(IAMFContext *iamf, const AVStreamGroup *stg,
     codec_config->sample_rate = st->codecpar->sample_rate;
     codec_config->codec_tag = st->codecpar->codec_tag;
     codec_config->nb_samples = st->codecpar->frame_size;
-    codec_config->seek_preroll = st->codecpar->seek_preroll;
+    populate_default_seek_preroll(codec_config);
     if (st->codecpar->extradata_size) {
         codec_config->extradata = av_memdup(st->codecpar->extradata, st->codecpar->extradata_size);
         if (!codec_config->extradata)
-- 
2.45.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [FFmpeg-devel] [PATCH 4/4] avformat/iamf: byteswap values in OpusHeader
  2024-07-17  1:49 [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 2/4] avformat/iamf_writer: fix PCM endian-ness flag James Almer
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 3/4] avformat/iamf_writer: fix coded audio_roll_distance values James Almer
@ 2024-07-17  1:49 ` James Almer
  2024-07-17  6:18 ` [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks Anton Khirnov
  3 siblings, 0 replies; 6+ messages in thread
From: James Almer @ 2024-07-17  1:49 UTC (permalink / raw)
  To: ffmpeg-devel

Clause 3.11.1 of IAMF[1] states the values are stored in big endian, in
contrast to the Ogg Encapsulation for Opus[2] where they are in little endian.

[1]https://aomediacodec.github.io/iamf/v1.0.0-errata.html#opus-specific
[2]https://datatracker.ietf.org/doc/html/rfc7845#section-5.1

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/iamf_parse.c      | 3 +++
 libavformat/iamf_writer.c     | 8 ++++++--
 tests/ref/fate/iamf-5_1-copy  | 8 ++++----
 tests/ref/fate/iamf-5_1-demux | 8 ++++----
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index 2674a5186d..8e9c48568f 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -272,6 +272,9 @@ static int update_extradata(AVCodecParameters *codecpar)
     switch(codecpar->codec_id) {
     case AV_CODEC_ID_OPUS:
         AV_WB8(codecpar->extradata + 9, codecpar->ch_layout.nb_channels);
+        AV_WL16(codecpar->extradata + 10, AV_RB16(codecpar->extradata + 10)); // Byte swap pre-skip
+        AV_WL32(codecpar->extradata + 12, AV_RB32(codecpar->extradata + 12)); // Byte swap sample rate
+        AV_WL16(codecpar->extradata + 16, AV_RB16(codecpar->extradata + 16)); // Byte swap Output Gain
         break;
     case AV_CODEC_ID_AAC: {
         uint8_t buf[5];
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index af837ccb1f..7522f15548 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -42,8 +42,12 @@ static int update_extradata(IAMFCodecConfig *codec_config)
         if (codec_config->extradata_size < 19)
             return AVERROR_INVALIDDATA;
         codec_config->extradata_size -= 8;
-        memmove(codec_config->extradata, codec_config->extradata + 8, codec_config->extradata_size);
-        AV_WB8(codec_config->extradata + 1, 2); // set channels to stereo
+        AV_WB8(codec_config->extradata  + 0, AV_RL8(codec_config->extradata + 8)); // version
+        AV_WB8(codec_config->extradata  + 1, 2); // set channels to stereo
+        AV_WB16(codec_config->extradata + 2, AV_RL16(codec_config->extradata + 10)); // Byte swap pre-skip
+        AV_WB32(codec_config->extradata + 4, AV_RL32(codec_config->extradata + 12)); // Byte swap sample rate
+        AV_WB16(codec_config->extradata + 8, 0); // set Output Gain to 0
+        AV_WB8(codec_config->extradata + 10, AV_RL8(codec_config->extradata + 18)); // Mapping family
         break;
     case AV_CODEC_ID_FLAC: {
         uint8_t buf[13];
diff --git a/tests/ref/fate/iamf-5_1-copy b/tests/ref/fate/iamf-5_1-copy
index bc4df7c57f..ed2046fe3b 100644
--- a/tests/ref/fate/iamf-5_1-copy
+++ b/tests/ref/fate/iamf-5_1-copy
@@ -1,7 +1,7 @@
-#extradata 0:       19, 0x379c0490
-#extradata 1:       19, 0x379c0490
-#extradata 2:       19, 0x3792048f
-#extradata 3:       19, 0x3792048f
+#extradata 0:       19, 0x3a0e0490
+#extradata 1:       19, 0x3a0e0490
+#extradata 2:       19, 0x3a04048f
+#extradata 3:       19, 0x3a04048f
 #tb 0: 1/48000
 #media_type 0: audio
 #codec_id 0: opus
diff --git a/tests/ref/fate/iamf-5_1-demux b/tests/ref/fate/iamf-5_1-demux
index bc4df7c57f..ed2046fe3b 100644
--- a/tests/ref/fate/iamf-5_1-demux
+++ b/tests/ref/fate/iamf-5_1-demux
@@ -1,7 +1,7 @@
-#extradata 0:       19, 0x379c0490
-#extradata 1:       19, 0x379c0490
-#extradata 2:       19, 0x3792048f
-#extradata 3:       19, 0x3792048f
+#extradata 0:       19, 0x3a0e0490
+#extradata 1:       19, 0x3a0e0490
+#extradata 2:       19, 0x3a04048f
+#extradata 3:       19, 0x3a04048f
 #tb 0: 1/48000
 #media_type 0: audio
 #codec_id 0: opus
-- 
2.45.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks
  2024-07-17  1:49 [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks James Almer
                   ` (2 preceding siblings ...)
  2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 4/4] avformat/iamf: byteswap values in OpusHeader James Almer
@ 2024-07-17  6:18 ` Anton Khirnov
  2024-07-17 11:29   ` James Almer
  3 siblings, 1 reply; 6+ messages in thread
From: Anton Khirnov @ 2024-07-17  6:18 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Quoting James Almer (2024-07-17 03:49:22)
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 2bea55e33d..5de188f4cf 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1399,6 +1399,11 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
>                  avio_wb16(pb, 16);
>              avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
>          } else { /* reserved for mp4/3gp */
> +#if CONFIG_IAMFENC
> +            if (track->tag == MKTAG('i','a','m','f'))
> +                avio_wb16(pb, 0); /* channelcount must be 0 for IAMF */
> +            else
> +#endif
>              avio_wb16(pb, track->par->ch_layout.nb_channels);

avio_wb16(pb, track->tag == MKTAG('i', 'a', 'm', 'f') ?
              0 : track->par->ch_layout.nb_channels);

looks more readable to me

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks
  2024-07-17  6:18 ` [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks Anton Khirnov
@ 2024-07-17 11:29   ` James Almer
  0 siblings, 0 replies; 6+ messages in thread
From: James Almer @ 2024-07-17 11:29 UTC (permalink / raw)
  To: ffmpeg-devel

On 7/17/2024 3:18 AM, Anton Khirnov wrote:
> Quoting James Almer (2024-07-17 03:49:22)
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index 2bea55e33d..5de188f4cf 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -1399,6 +1399,11 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
>>                   avio_wb16(pb, 16);
>>               avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
>>           } else { /* reserved for mp4/3gp */
>> +#if CONFIG_IAMFENC
>> +            if (track->tag == MKTAG('i','a','m','f'))
>> +                avio_wb16(pb, 0); /* channelcount must be 0 for IAMF */
>> +            else
>> +#endif
>>               avio_wb16(pb, track->par->ch_layout.nb_channels);
> 
> avio_wb16(pb, track->tag == MKTAG('i', 'a', 'm', 'f') ?
>                0 : track->par->ch_layout.nb_channels);
> 
> looks more readable to me

Ok, changed locally.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-17 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17  1:49 [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks James Almer
2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 2/4] avformat/iamf_writer: fix PCM endian-ness flag James Almer
2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 3/4] avformat/iamf_writer: fix coded audio_roll_distance values James Almer
2024-07-17  1:49 ` [FFmpeg-devel] [PATCH 4/4] avformat/iamf: byteswap values in OpusHeader James Almer
2024-07-17  6:18 ` [FFmpeg-devel] [PATCH 1/4] avformat/movenc: fix channel count and samplerate fields for IAMF tracks Anton Khirnov
2024-07-17 11:29   ` James Almer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git