From 0e4d2e7277bc2adf18dd1e719ec4ce684f86d72b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 20 Oct 2013 23:09:51 +0200 Subject: Util/ASCII: add function StringEqualsCaseASCII() Replaces GLib's g_ascii_strcasecmp(). --- src/decoder/MadDecoderPlugin.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx index a6c53bfb6..260ee1900 100644 --- a/src/decoder/MadDecoderPlugin.cxx +++ b/src/decoder/MadDecoderPlugin.cxx @@ -26,6 +26,7 @@ #include "tag/TagRva2.hxx" #include "tag/TagHandler.hxx" #include "CheckAudioFormat.hxx" +#include "util/ASCII.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -272,16 +273,16 @@ parse_id3_replay_gain_info(struct replay_gain_info *replay_gain_info, id3_ucs4_latin1duplicate(id3_field_getstring (&frame->fields[2])); - if (g_ascii_strcasecmp(key, "replaygain_track_gain") == 0) { + if (StringEqualsCaseASCII(key, "replaygain_track_gain")) { replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = atof(value); found = true; - } else if (g_ascii_strcasecmp(key, "replaygain_album_gain") == 0) { + } else if (StringEqualsCaseASCII(key, "replaygain_album_gain")) { replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = atof(value); found = true; - } else if (g_ascii_strcasecmp(key, "replaygain_track_peak") == 0) { + } else if (StringEqualsCaseASCII(key, "replaygain_track_peak")) { replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = atof(value); found = true; - } else if (g_ascii_strcasecmp(key, "replaygain_album_peak") == 0) { + } else if (StringEqualsCaseASCII(key, "replaygain_album_peak")) { replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = atof(value); found = true; } @@ -321,10 +322,10 @@ parse_id3_mixramp(char **mixramp_start, char **mixramp_end, id3_ucs4_latin1duplicate(id3_field_getstring (&frame->fields[2])); - if (g_ascii_strcasecmp(key, "mixramp_start") == 0) { + if (StringEqualsCaseASCII(key, "mixramp_start")) { *mixramp_start = g_strdup(value); found = true; - } else if (g_ascii_strcasecmp(key, "mixramp_end") == 0) { + } else if (StringEqualsCaseASCII(key, "mixramp_end")) { *mixramp_end = g_strdup(value); found = true; } -- cgit v1.2.3