diff options
author | Matti Hamalainen <(mhamalai@students.oamk.fi> | 2009-08-11 17:18:10 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2009-08-11 17:18:10 +0000 |
commit | 311f96a8cc2463bc310bf15676b2c8d9b969a6ee (patch) | |
tree | 09af4e6dd47890082805d710331d4fa2c5eb7372 /libavformat | |
parent | 191e34cd67e46e125782073283346fda459d2146 (diff) | |
download | ffmpeg-streaming-311f96a8cc2463bc310bf15676b2c8d9b969a6ee.zip ffmpeg-streaming-311f96a8cc2463bc310bf15676b2c8d9b969a6ee.tar.gz |
Parse APE metadata tags in Musepack SV7 files
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
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 2 | ||||
-rw-r--r-- | libavformat/mpc.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index 10b8fbe..86dc03f 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -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 diff --git a/libavformat/mpc.c b/libavformat/mpc.c index f2b219a..03aa7f0 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -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; } |