PR #23370 opened by toots
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23370
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23370.patch

This is a bit of a confusing situation because there is already a `apac` codec 
in the code base (see: https://www.rarewares.org/rrw/apac.php) leading to some 
confusion because the `mov` box for apple's APAC is also named `apac`.

With these changes, at least apple's APAC is properly reported with a distinct 
name.

Before:
```
  Stream #0:0[0x1]: Audio: apac_apple (apac / 0x63617061), 48000 Hz, 4 
channels, 363 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
```

After:
```
  Stream #0:0[0x1]: Audio: apple_apac (apac / 0x63617061), 48000 Hz, 4 
channels, 363 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
```


>From 0909dfef1560000cd7dc2eec08974fd6b3a0de11 Mon Sep 17 00:00:00 2001
From: Romain Beauxis <[email protected]>
Date: Fri, 5 Jun 2026 11:21:20 -0500
Subject: [PATCH 1/2] avcodec/codec_id: Add Apple Positional Audio Codec.

Signed-off-by: Romain Beauxis <[email protected]>
---
 libavcodec/codec_desc.c | 7 +++++++
 libavcodec/codec_id.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 99e7c0de3d..7b160e5845 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3575,6 +3575,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("CRI AHX"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
     },
+    {
+        .id        = AV_CODEC_ID_APPLE_APAC,
+        .type      = AVMEDIA_TYPE_AUDIO,
+        .name      = "apple_apac",
+        .long_name = NULL_IF_CONFIG_SMALL("Apple Positional Audio Codec"),
+        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+    },
 
     /* subtitle codecs */
     {
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index bb2c16a958..1aad9ba0e9 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -567,6 +567,7 @@ enum AVCodecID {
     AV_CODEC_ID_LC3,
     AV_CODEC_ID_G728,
     AV_CODEC_ID_AHX,
+    AV_CODEC_ID_APPLE_APAC,
 
     /* subtitle codecs */
     AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at 
the start of subtitle codecs.
-- 
2.52.0


>From 7677af58d18803f8b8e4a49ce897599eb34e1c17 Mon Sep 17 00:00:00 2001
From: Romain Beauxis <[email protected]>
Date: Fri, 5 Jun 2026 11:22:17 -0500
Subject: [PATCH 2/2] avformat//isom_tags: Add support for demuxing apple_apac

Signed-off-by: Romain Beauxis <[email protected]>
---
 libavformat/isom_tags.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c
index 1cd655b06c..556f0eeea4 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -310,6 +310,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
 
 const AVCodecTag ff_codec_movaudio_tags[] = {
     { AV_CODEC_ID_AAC,             MKTAG('m', 'p', '4', 'a') },
+    { AV_CODEC_ID_APPLE_APAC,      MKTAG('a', 'p', 'a', 'c') },
     { AV_CODEC_ID_AC3,             MKTAG('a', 'c', '-', '3') }, /* ETSI TS 102 
366 Annex F */
     { AV_CODEC_ID_AC3,             MKTAG('s', 'a', 'c', '3') }, /* Nero Recode 
*/
     { AV_CODEC_ID_AC4,             MKTAG('a', 'c', '-', '4') },
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to