aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/decoder/_flac_common.c12
-rw-r--r--src/decoder/_flac_common.h2
-rw-r--r--src/decoder/flac_plugin.c6
-rw-r--r--src/decoder/oggflac_plugin.c3
4 files changed, 12 insertions, 11 deletions
diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c
index fca76d11..33cfd9c3 100644
--- a/src/decoder/_flac_common.c
+++ b/src/decoder/_flac_common.c
@@ -199,13 +199,10 @@ flac_parse_comment(struct tag *tag, const char *char_tnum,
void
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
- const FLAC__StreamMetadata *block)
+ const FLAC__StreamMetadata_VorbisComment *comment)
{
- FLAC__StreamMetadata_VorbisComment_Entry *comments =
- block->data.vorbis_comment.comments;
-
- for (unsigned i = block->data.vorbis_comment.num_comments; i > 0; --i)
- flac_parse_comment(tag, char_tnum, comments++);
+ for (unsigned i = 0; i < comment->num_comments; ++i)
+ flac_parse_comment(tag, char_tnum, &comment->comments[i]);
}
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
@@ -223,7 +220,8 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
flac_parse_replay_gain(block, data);
if (data->tag != NULL)
- flac_vorbis_comments_to_tag(data->tag, NULL, block);
+ flac_vorbis_comments_to_tag(data->tag, NULL,
+ &block->data.vorbis_comment);
default:
break;
diff --git a/src/decoder/_flac_common.h b/src/decoder/_flac_common.h
index 0172ed2b..fc240aa1 100644
--- a/src/decoder/_flac_common.h
+++ b/src/decoder/_flac_common.h
@@ -176,7 +176,7 @@ void flac_error_common_cb(const char *plugin,
void
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
- const FLAC__StreamMetadata *block);
+ const FLAC__StreamMetadata_VorbisComment *comment);
FLAC__StreamDecoderWriteStatus
flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 73d82a65..e2620c67 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -269,7 +269,8 @@ flac_tag_load(const char *file, const char *char_tnum)
if (!block)
break;
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
- flac_vorbis_comments_to_tag(tag, char_tnum, block);
+ flac_vorbis_comments_to_tag(tag, char_tnum,
+ &block->data.vorbis_comment);
} else if (block->type == FLAC__METADATA_TYPE_STREAMINFO) {
tag->time = ((float)block->data.stream_info.total_samples) /
block->data.stream_info.sample_rate + 0.5;
@@ -849,7 +850,8 @@ oggflac_tag_dup(const char *file)
if (!(block = FLAC__metadata_iterator_get_block(it)))
break;
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
- flac_vorbis_comments_to_tag(ret, NULL, block);
+ flac_vorbis_comments_to_tag(ret, NULL,
+ &block->data.vorbis_comment);
} else if (block->type == FLAC__METADATA_TYPE_STREAMINFO) {
ret->time = ((float)block->data.stream_info.
total_samples) /
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c
index 0c9b881b..0f5e774c 100644
--- a/src/decoder/oggflac_plugin.c
+++ b/src/decoder/oggflac_plugin.c
@@ -177,7 +177,8 @@ static void of_metadata_dup_cb(G_GNUC_UNUSED const OggFLAC__SeekableStreamDecode
block->data.stream_info.sample_rate + 0.5;
return;
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
- flac_vorbis_comments_to_tag(data->tag, NULL, block);
+ flac_vorbis_comments_to_tag(data->tag, NULL,
+ &block->data.vorbis_comment);
default:
break;
}