decoder/{vorbis,flac}: move duplicate code to tag/VorbisComment.cxx

This commit is contained in:
Max Kellermann
2014-09-24 20:56:25 +02:00
parent 05dd9acba8
commit d1e31261fe
5 changed files with 79 additions and 24 deletions

View File

@@ -23,26 +23,14 @@
#include "tag/TagTable.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "tag/VorbisComment.hxx"
#include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx"
#include "util/SplitString.hxx"
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
static const char *
vorbis_comment_value(const char *comment, const char *needle)
{
size_t len = strlen(needle);
if (StringEqualsCaseASCII(comment, needle, len) &&
comment[len] == '=')
return comment + len + 1;
return nullptr;
}
bool
vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments)
{