From c6c644318b595378cf7f2838eb65199a36e5f5ca Mon Sep 17 00:00:00 2001
From: Bob Kirnum <bkirnum@gmail.com>
Date: Wed, 17 May 2017 07:36:55 -0400
Subject: [PATCH 1/1] Add AMR NB/WB to MP4 container

---
 libavformat/isom.c   | 2 ++
 libavformat/movenc.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 5522115..49ba735 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -69,6 +69,8 @@ const AVCodecTag ff_mp4_obj_type[] = {
     { AV_CODEC_ID_QCELP       , 0xE1 },
     { AV_CODEC_ID_MPEG4SYSTEMS, 0x01 },
     { AV_CODEC_ID_MPEG4SYSTEMS, 0x02 },
+    { AV_CODEC_ID_AMR_NB      , MKTAG('s', 'a', 'm', 'r') }, /* AMR-NB 3gp */
+    { AV_CODEC_ID_AMR_WB      , MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
     { AV_CODEC_ID_NONE        ,    0 },
 };
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d20d272..7f44163 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1241,6 +1241,8 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
     else if (track->par->codec_id == AV_CODEC_ID_VC1)       tag = MKTAG('v','c','-','1');
     else if (track->par->codec_id == AV_CODEC_ID_FLAC)      tag = MKTAG('f','L','a','C');
     else if (track->par->codec_id == AV_CODEC_ID_OPUS)      tag = MKTAG('O','p','u','s');
+    else if (track->par->codec_id == AV_CODEC_ID_AMR_NB)    tag = MKTAG('s','a','m','r');
+    else if (track->par->codec_id == AV_CODEC_ID_AMR_WB)    tag = MKTAG('s','a','w','b');
     else if (track->par->codec_type == AVMEDIA_TYPE_VIDEO)  tag = MKTAG('m','p','4','v');
     else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)  tag = MKTAG('m','p','4','a');
     else if (track->par->codec_id == AV_CODEC_ID_DVD_SUBTITLE)  tag = MKTAG('m','p','4','s');
-- 
1.8.3.1

