Module: libav
Branch: release/11
Commit: d723322b85dcf0ac98d17716cbd983a4413a4012

Author:    Anton Khirnov <an...@khirnov.net>
Committer: Sean McGovern <gsean...@gmail.com>
Date:      Sat Jul  1 10:49:58 2017 +0200

caf: add an Opus tag

CC: libav-sta...@libav.org
(cherry picked from commit 48a5c35346aeded1c65b8709bbb085fa4e705c91)
Signed-off-by: Sean McGovern <gsean...@gmail.com>

---

 libavformat/caf.c    | 1 +
 libavformat/cafdec.c | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/libavformat/caf.c b/libavformat/caf.c
index cf128d5..c299cad 100644
--- a/libavformat/caf.c
+++ b/libavformat/caf.c
@@ -49,6 +49,7 @@ const AVCodecTag ff_codec_caf_tags[] = {
     { AV_CODEC_ID_QCELP,           MKBETAG('Q','c','l','p') },
     { AV_CODEC_ID_QDM2,            MKBETAG('Q','D','M','2') },
     { AV_CODEC_ID_QDM2,            MKBETAG('Q','D','M','C') },
+    { AV_CODEC_ID_OPUS,            MKBETAG('o','p','u','s') },
   /* currently unsupported codecs */
   /*{ AC-3 over S/PDIF          MKBETAG('c','a','c','3') },*/
   /*{ MPEG4CELP                 MKBETAG('c','e','l','p') },*/
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 0034f00..5172a4e 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -156,6 +156,14 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t 
size)
             avio_skip(pb, size - ALAC_NEW_KUKI);
         }
         st->codec->extradata_size = ALAC_HEADER;
+    } else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
+        // The data layout for Opus is currently unknown, so we do not export
+        // extradata at all. Multichannel streams are not supported.
+        if (st->codec->channels > 2) {
+            avpriv_request_sample(s, "multichannel Opus in CAF");
+            return AVERROR_PATCHWELCOME;
+        }
+        avio_skip(pb, size);
     } else {
         st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
         if (!st->codec->extradata)

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to