]> git.sesse.net Git - ffmpeg/commitdiff
Parse APE metadata tags in Musepack SV7 files
authorMatti Hamalainen <(mhamalai@students.oamk.fi>
Tue, 11 Aug 2009 17:18:10 +0000 (17:18 +0000)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 11 Aug 2009 17:18:10 +0000 (17:18 +0000)
Patch by Matti Hamalainen (to get his mail address remove common endings from
 "mhamalainen@studentsnen.oamknen.finen")
Thread: [PATCH]5/6 Add APE tag metadata reading support in Musepack SV7 demuxer

Originally committed as revision 19630 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/Makefile
libavformat/mpc.c

index 10b8fbeadf7f7aa17df38c8bb7ed1176aafc2d27..86dc03f8e02fcb467d68bbad44efed8f5cac5a9d 100644 (file)
@@ -95,7 +95,7 @@ OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o riff.o isom.o avc.o
 OBJS-$(CONFIG_MP2_MUXER)                 += mp3.o id3v1.o
 OBJS-$(CONFIG_MP3_DEMUXER)               += mp3.o id3v1.o id3v2.o
 OBJS-$(CONFIG_MP3_MUXER)                 += mp3.o id3v1.o
-OBJS-$(CONFIG_MPC_DEMUXER)               += mpc.o id3v1.o id3v2.o
+OBJS-$(CONFIG_MPC_DEMUXER)               += mpc.o id3v1.o id3v2.o apetag.o
 OBJS-$(CONFIG_MPC8_DEMUXER)              += mpc8.o
 OBJS-$(CONFIG_MPEG1SYSTEM_MUXER)         += mpegenc.o
 OBJS-$(CONFIG_MPEG1VCD_MUXER)            += mpegenc.o
index f2b219a9ef6df8ecbb3dbc6181821fec2587b576..03aa7f0d57633835ecf9f22848d037479e0785bc 100644 (file)
@@ -22,6 +22,7 @@
 #include "libavcodec/get_bits.h"
 #include "avformat.h"
 #include "id3v2.h"
+#include "apetag.h"
 
 #define MPC_FRAMESIZE  1152
 #define DELAY_FRAMES   32
@@ -111,6 +112,13 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
     s->start_time = 0;
     s->duration = (int64_t)c->fcount * MPC_FRAMESIZE * AV_TIME_BASE / st->codec->sample_rate;
 
+    /* try to read APE tags */
+    if (!url_is_streamed(s->pb)) {
+        int64_t pos = url_ftell(s->pb);
+        ff_ape_parse_tag(s);
+        url_fseek(s->pb, pos, SEEK_SET);
+    }
+
     return 0;
 }