[FFmpeg-cvslog] Support writing E-AC3 in wav.

Carl Eugen Hoyos git at videolan.org
Wed Jan 29 04:32:33 CET 2014


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Jan 29 00:48:50 2014 +0100| [bf9a8d183ddcc65b5ae473bb048a3d38bd6df9f3] | committer: Carl Eugen Hoyos

Support writing E-AC3 in wav.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf9a8d183ddcc65b5ae473bb048a3d38bd6df9f3
---

 libavformat/riff.c    |    2 ++
 libavformat/riffenc.c |    5 +++++
 libavformat/version.h |    2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 671baa6..5e01be7 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -413,6 +413,8 @@ const AVCodecTag ff_codec_wav_tags[] = {
     { AV_CODEC_ID_AAC,             0x1600 },
     { AV_CODEC_ID_AAC_LATM,        0x1602 },
     { AV_CODEC_ID_AC3,             0x2000 },
+    /* There is no Microsoft Format Tag for E-AC3, the GUID has to be used */
+    { AV_CODEC_ID_EAC3,            0x2000 },
     { AV_CODEC_ID_DTS,             0x2001 },
     { AV_CODEC_ID_SONIC,           0x2048 },
     { AV_CODEC_ID_SONIC_LS,        0x2048 },
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 7828610..2af2b7f 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -72,6 +72,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
 
     waveformatextensible = (enc->channels > 2 && enc->channel_layout) ||
                            enc->sample_rate > 48000 ||
+                           enc->codec_id == AV_CODEC_ID_EAC3 ||
                            av_get_bits_per_sample(enc->codec_id) > 16;
 
     if (waveformatextensible)
@@ -183,10 +184,14 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
         /* dwChannelMask */
         avio_wl32(pb, enc->channel_layout);
         /* GUID + next 3 */
+        if (enc->codec_id == AV_CODEC_ID_EAC3) {
+            ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids));
+        } else {
         avio_wl32(pb, enc->codec_tag);
         avio_wl32(pb, 0x00100000);
         avio_wl32(pb, 0xAA000080);
         avio_wl32(pb, 0x719B3800);
+        }
     } else {
         avio_wl16(pb, riff_extradata - riff_extradata_start); /* cbSize */
     }
diff --git a/libavformat/version.h b/libavformat/version.h
index 92f81a9..a052d3c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 55
 #define LIBAVFORMAT_VERSION_MINOR 28
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list