diff options
Diffstat (limited to 'src/decoder/_flac_common.c')
-rw-r--r-- | src/decoder/_flac_common.c | 21 |
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) { |