# HG changeset patch # User kostya # Date 1250011090 0 # Node ID cdaab3d9f0d64dd9fb53564f5a745b91403875a8 # Parent 6c0318c8a1275a2ff8754fc0530e5d032493aae7 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 diff -r 6c0318c8a127 -r cdaab3d9f0d6 Makefile --- a/Makefile Tue Aug 11 17:08:09 2009 +0000 +++ b/Makefile Tue Aug 11 17:18:10 2009 +0000 @@ -95,7 +95,7 @@ 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 -r 6c0318c8a127 -r cdaab3d9f0d6 mpc.c --- a/mpc.c Tue Aug 11 17:08:09 2009 +0000 +++ b/mpc.c Tue Aug 11 17:18:10 2009 +0000 @@ -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 @@ 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; }