aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/_flac_common.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-11 00:05:14 +0100
committerMax Kellermann <max@duempel.org>2009-11-11 00:05:14 +0100
commit884be8e2b33c4ae536ee72ed1783aacdfe35bd6b (patch)
tree582c9da8f6599c9d578e6f261414854aa76c05f1 /src/decoder/_flac_common.c
parent305de100a7f9ab7c62c4a2f3f447919d98879a3f (diff)
downloadmpd-884be8e2b33c4ae536ee72ed1783aacdfe35bd6b.tar.gz
mpd-884be8e2b33c4ae536ee72ed1783aacdfe35bd6b.tar.xz
mpd-884be8e2b33c4ae536ee72ed1783aacdfe35bd6b.zip
decoder/flac: merged some code into flac_tag_apply_metadata()
Diffstat (limited to 'src/decoder/_flac_common.c')
-rw-r--r--src/decoder/_flac_common.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c
index 33cfd9c3c..9b3272cf2 100644
--- a/src/decoder/_flac_common.c
+++ b/src/decoder/_flac_common.c
@@ -197,7 +197,7 @@ flac_parse_comment(struct tag *tag, const char *char_tnum,
return;
}
-void
+static void
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
const FLAC__StreamMetadata_VorbisComment *comment)
{
@@ -205,6 +205,25 @@ flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
flac_parse_comment(tag, char_tnum, &comment->comments[i]);
}
+void
+flac_tag_apply_metadata(struct tag *tag, const char *track,
+ const FLAC__StreamMetadata *block)
+{
+ switch (block->type) {
+ case FLAC__METADATA_TYPE_VORBIS_COMMENT:
+ flac_vorbis_comments_to_tag(tag, track,
+ &block->data.vorbis_comment);
+ break;
+
+ case FLAC__METADATA_TYPE_STREAMINFO:
+ tag->time = flac_duration(&block->data.stream_info);
+ break;
+
+ default:
+ break;
+ }
+}
+
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
struct flac_data *data)
{