# HG changeset patch # User kostya # Date 1255879733 0 # Node ID e5c9ae62af86b5982647584b06f65a24f8661fff # Parent 1406417325ea9b9186c994639877313939dc7061 Read metadata in WavPack files. Patch by Anton Khirnov (acronym("What You Should Know About Something"), gmail) diff -r 1406417325ea -r e5c9ae62af86 wv.c --- a/wv.c Sun Oct 18 12:17:01 2009 +0000 +++ b/wv.c Sun Oct 18 15:28:53 2009 +0000 @@ -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 @@ 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; }