[FFmpeg-devel] [PATCH] Support raw TrueHD files

ramiro at lisha.ufsc.br ramiro
Wed Mar 18 02:30:46 CET 2009


From: Ramiro Polla <ramiro at ubuntu-8.10-macbook>

---
 doc/general.texi         |    1 +
 libavformat/Makefile     |    2 ++
 libavformat/allformats.c |    1 +
 libavformat/avformat.h   |    4 ++--
 libavformat/raw.c        |   29 +++++++++++++++++++++++++++++
 5 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/doc/general.texi b/doc/general.texi
index 820a2ed..5fadc9e 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -162,6 +162,7 @@ library:
 @item raw video                 @tab X @tab X
 @item raw id RoQ                @tab X @tab
 @item raw Shorten               @tab   @tab X
+ at item raw TrueHD                @tab   @tab X
 @item raw VC-1                  @tab   @tab X
 @item raw PCM A-law             @tab X @tab X
 @item raw PCM mu-law            @tab X @tab X
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 426ca92..b35b69a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -204,6 +204,8 @@ OBJS-$(CONFIG_SWF_DEMUXER)               += swfdec.o
 OBJS-$(CONFIG_SWF_MUXER)                 += swfenc.o
 OBJS-$(CONFIG_TG2_MUXER)                 += movenc.o riff.o isom.o avc.o
 OBJS-$(CONFIG_TGP_MUXER)                 += movenc.o riff.o isom.o avc.o
+OBJS-$(CONFIG_THD_DEMUXER)               += raw.o id3v2.o
+OBJS-$(CONFIG_THD_MUXER)                 += raw.o
 OBJS-$(CONFIG_THP_DEMUXER)               += thp.o
 OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER)        += tiertexseq.o
 OBJS-$(CONFIG_TTA_DEMUXER)               += tta.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index c4d0de4..293ea5e 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -180,6 +180,7 @@ void av_register_all(void)
     REGISTER_MUXDEMUX (SWF, swf);
     REGISTER_MUXER    (TG2, tg2);
     REGISTER_MUXER    (TGP, tgp);
+    REGISTER_MUXDEMUX (THD, thd);
     REGISTER_DEMUXER  (THP, thp);
     REGISTER_DEMUXER  (TIERTEXSEQ, tiertexseq);
     REGISTER_DEMUXER  (TTA, tta);
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index da23709..5458db9 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -22,8 +22,8 @@
 #define AVFORMAT_AVFORMAT_H
 
 #define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 31
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MINOR 32
+#define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
diff --git a/libavformat/raw.c b/libavformat/raw.c
index 224c26f..e67d5ee 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -968,6 +968,35 @@ AVInputFormat mlp_demuxer = {
 };
 #endif
 
+#if CONFIG_THD_DEMUXER
+AVInputFormat thd_demuxer = {
+    "thd",
+    NULL_IF_CONFIG_SMALL("raw TrueHD"),
+    0,
+    NULL,
+    audio_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "thd",
+    .value = CODEC_ID_TRUEHD,
+};
+#endif
+
+#ifdef CONFIG_THD_MUXER
+AVOutputFormat thd_muxer = {
+    "thd",
+    NULL_IF_CONFIG_SMALL("raw TrueHD"),
+    NULL,
+    "thd",
+    0,
+    CODEC_ID_TRUEHD,
+    CODEC_ID_NONE,
+    NULL,
+    raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
 #if CONFIG_MPEG1VIDEO_MUXER
 AVOutputFormat mpeg1video_muxer = {
     "mpeg1video",
-- 
1.5.6.3





More information about the ffmpeg-devel mailing list