decoder/flac: pass VorbisComment to comments_to_tag()
This commit is contained in:
parent
2f69831fb8
commit
e51d9fc6a9
@ -199,13 +199,10 @@ flac_parse_comment(struct tag *tag, const char *char_tnum,
|
|||||||
|
|
||||||
void
|
void
|
||||||
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
|
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 =
|
for (unsigned i = 0; i < comment->num_comments; ++i)
|
||||||
block->data.vorbis_comment.comments;
|
flac_parse_comment(tag, char_tnum, &comment->comments[i]);
|
||||||
|
|
||||||
for (unsigned i = block->data.vorbis_comment.num_comments; i > 0; --i)
|
|
||||||
flac_parse_comment(tag, char_tnum, comments++);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
|
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);
|
flac_parse_replay_gain(block, data);
|
||||||
|
|
||||||
if (data->tag != NULL)
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -176,7 +176,7 @@ void flac_error_common_cb(const char *plugin,
|
|||||||
|
|
||||||
void
|
void
|
||||||
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
|
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,
|
||||||
const FLAC__StreamMetadata *block);
|
const FLAC__StreamMetadata_VorbisComment *comment);
|
||||||
|
|
||||||
FLAC__StreamDecoderWriteStatus
|
FLAC__StreamDecoderWriteStatus
|
||||||
flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
|
flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
|
||||||
|
@ -269,7 +269,8 @@ flac_tag_load(const char *file, const char *char_tnum)
|
|||||||
if (!block)
|
if (!block)
|
||||||
break;
|
break;
|
||||||
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
|
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) {
|
} else if (block->type == FLAC__METADATA_TYPE_STREAMINFO) {
|
||||||
tag->time = ((float)block->data.stream_info.total_samples) /
|
tag->time = ((float)block->data.stream_info.total_samples) /
|
||||||
block->data.stream_info.sample_rate + 0.5;
|
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)))
|
if (!(block = FLAC__metadata_iterator_get_block(it)))
|
||||||
break;
|
break;
|
||||||
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
|
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) {
|
} else if (block->type == FLAC__METADATA_TYPE_STREAMINFO) {
|
||||||
ret->time = ((float)block->data.stream_info.
|
ret->time = ((float)block->data.stream_info.
|
||||||
total_samples) /
|
total_samples) /
|
||||||
|
@ -177,7 +177,8 @@ static void of_metadata_dup_cb(G_GNUC_UNUSED const OggFLAC__SeekableStreamDecode
|
|||||||
block->data.stream_info.sample_rate + 0.5;
|
block->data.stream_info.sample_rate + 0.5;
|
||||||
return;
|
return;
|
||||||
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user