tta: add support for reading ape tags
authorPaul B Mahol <onemda@gmail.com>
Mon, 3 Jun 2013 22:52:50 +0000 (22:52 +0000)
committerPaul B Mahol <onemda@gmail.com>
Mon, 3 Jun 2013 23:04:43 +0000 (23:04 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/Makefile
libavformat/tta.c

index 7af1589..69ab63b 100644 (file)
@@ -370,7 +370,7 @@ OBJS-$(CONFIG_MKVTIMESTAMP_V2_MUXER)     += mkvtimestamp_v2.o
 OBJS-$(CONFIG_TMV_DEMUXER)               += tmv.o
 OBJS-$(CONFIG_TRUEHD_DEMUXER)            += rawdec.o
 OBJS-$(CONFIG_TRUEHD_MUXER)              += rawenc.o
-OBJS-$(CONFIG_TTA_DEMUXER)               += tta.o
+OBJS-$(CONFIG_TTA_DEMUXER)               += tta.o apetag.o
 OBJS-$(CONFIG_TTY_DEMUXER)               += tty.o sauce.o
 OBJS-$(CONFIG_TXD_DEMUXER)               += txd.o
 OBJS-$(CONFIG_VC1_DEMUXER)               += rawdec.o
index 7db1a90..f9ef597 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "libavcodec/get_bits.h"
+#include "apetag.h"
 #include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
@@ -58,6 +59,10 @@ static int tta_read_header(AVFormatContext *s)
     uint64_t framepos, start_offset;
     uint32_t datalen, crc;
 
+    if (s->pb->seekable) {
+        ff_ape_parse_tag(s);
+        avio_seek(s->pb, 0, SEEK_SET);
+    }
     if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
         ff_id3v1_read(s);