From 898a13f196eb005c969794bf16d8afa858a48f33 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Jul 2010 18:26:13 +0200 Subject: decoder/wildmidi: support version 0.2.3 In libwildmidi 0.2.3, the function WildMidi_SampledSeek() was removed, without changing the SO name. This patch adds an autoconf check for that function. Fall back to WildMidi_FastSeek() if WildMidi_SampledSeek() is not available anymore. --- src/decoder/wildmidi_plugin.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/decoder') diff --git a/src/decoder/wildmidi_plugin.c b/src/decoder/wildmidi_plugin.c index 8bad6943a..b5e9810f9 100644 --- a/src/decoder/wildmidi_plugin.c +++ b/src/decoder/wildmidi_plugin.c @@ -99,7 +99,11 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs) unsigned long seek_where = WILDMIDI_SAMPLE_RATE * decoder_seek_where(decoder); +#ifdef HAVE_WILDMIDI_SAMPLED_SEEK WildMidi_SampledSeek(wm, &seek_where); +#else + WildMidi_FastSeek(wm, &seek_where); +#endif decoder_command_finished(decoder); cmd = DECODE_COMMAND_NONE; } -- cgit v1.2.3 From 172182b18f00e062a4eae22dd4d0032750f37367 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Jul 2010 18:11:58 +0200 Subject: decoder/mad: parse_rva2() returns bool --- src/decoder/mad_plugin.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index ee07ae5a4..88bc4c214 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -209,14 +209,14 @@ mp3_fill_buffer(struct mp3_data *data) #ifdef HAVE_ID3TAG /* Parse mp3 RVA2 frame. Shamelessly stolen from madplay. */ -static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gain_info) +static bool +parse_rva2(struct id3_tag *tag, struct replay_gain_info *replay_gain_info) { struct id3_frame const * frame; id3_latin1_t const *id; id3_byte_t const *data; id3_length_t length; - int found; enum { CHANNEL_OTHER = 0x00, @@ -230,18 +230,18 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai CHANNEL_SUBWOOFER = 0x08 }; - found = 0; - /* relative volume adjustment information */ frame = id3_tag_findframe(tag, "RVA2", 0); - if (!frame) return 0; + if (frame == NULL) + return false; id = id3_field_getlatin1(id3_frame_field(frame, 0)); data = id3_field_getbinarydata(id3_frame_field(frame, 1), &length); - if (!id || !data) return 0; + if (id == NULL || data == NULL) + return false; /* * "The 'identification' string is used to identify the @@ -284,15 +284,14 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai "%+.1f dB adjustment (%s)\n", voladj_float, id); - found = 1; - break; + return true; } data += 4 + peak_bytes; length -= 4 + peak_bytes; } - return found; + return false; } #endif -- cgit v1.2.3 From 8b055c3127fb65aaeceb571b7db264c066b9cc3f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Jul 2010 22:32:55 +0200 Subject: tag_rva2: set "gain", not "peak" RVA2 tags only store the "gain" value, there is no "peak" attribute. --- src/decoder/mad_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index 88bc4c214..9b3259485 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -277,8 +277,8 @@ parse_rva2(struct id3_tag *tag, struct replay_gain_info *replay_gain_info) voladj_float = (double) voladj_fixed / 512; - replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = voladj_float; - replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = voladj_float; + replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = voladj_float; + replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = voladj_float; g_debug("parseRVA2: Relative Volume " "%+.1f dB adjustment (%s)\n", -- cgit v1.2.3