aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wv.c
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-10-18 15:28:53 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-10-18 15:28:53 +0000
commitc4d438c265d9c65926624023412a720495c32d36 (patch)
tree00772535d8bbc5b35960dcbd3232aca438b1169a /libavformat/wv.c
parent53bc53ae4effe8a85b97a5f6e92c668f2e46dc2c (diff)
downloadffmpeg-c4d438c265d9c65926624023412a720495c32d36.tar.gz
Read metadata in WavPack files.
Patch by Anton Khirnov (acronym("What You Should Know About Something"), gmail) Originally committed as revision 20279 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/wv.c')
-rw-r--r--libavformat/wv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/wv.c b/libavformat/wv.c
index d46f90d78b..ffb2b35c63 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -21,6 +21,8 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "apetag.h"
+#include "id3v1.h"
// specs say that maximum block size is 1Mb
#define WV_BLOCK_LIMIT 1047576
@@ -146,6 +148,15 @@ static int wv_read_header(AVFormatContext *s,
av_set_pts_info(st, 64, 1, wc->rate);
s->start_time = 0;
s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate;
+
+ if(!url_is_streamed(s->pb)) {
+ int64_t cur = url_ftell(s->pb);
+ ff_ape_parse_tag(s);
+ if(!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
+ ff_id3v1_read(s);
+ url_fseek(s->pb, cur, SEEK_SET);
+ }
+
return 0;
}