From 35c5a371ea3530796e88bcdd556e488816dff20f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 27 Feb 2010 18:35:31 +0100 Subject: decoder/mad: fix crash when seeking at end of song Removed the decoder_command_finished() call at the end of mp3_decode(). This is invalid, because decoder_command_finished() has already been called in mp3_read(). --- src/decoder/mad_plugin.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index 1ef7183fa..7cc78a0d2 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -1207,10 +1207,6 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream) if (replay_gain_info) replay_gain_info_free(replay_gain_info); - if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK && - data.mute_frame == MUTEFRAME_SEEK) - decoder_command_finished(decoder); - mp3_data_finish(&data); } -- cgit v1.2.3 From 96033e4b4e9ed599d8663a4d2d5a9dd586957bab Mon Sep 17 00:00:00 2001 From: Piotr Gozdur Date: Wed, 17 Mar 2010 17:54:21 +0100 Subject: decoder/mpcdec: fix negative shift on fixed-point samples "There is a bug in fixed-point musepack (musepack_src_r435) playback. In floating-point audio is OK but in fixed audio is distorted. I have made a patch for this" --- src/decoder/mpcdec_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/decoder') diff --git a/src/decoder/mpcdec_plugin.c b/src/decoder/mpcdec_plugin.c index 26349f93a..b3582c689 100644 --- a/src/decoder/mpcdec_plugin.c +++ b/src/decoder/mpcdec_plugin.c @@ -103,7 +103,7 @@ mpc_to_mpd_sample(MPC_SAMPLE_FORMAT sample) const int shift = bits - MPC_FIXED_POINT_SCALE_SHIFT; if (shift < 0) - val = sample << -shift; + val = sample >> -shift; else val = sample << shift; #else -- cgit v1.2.3 From 73ba4ea3da0a066f6241e661ca145f3aa0d64d09 Mon Sep 17 00:00:00 2001 From: Aleksei Kaveshnikov <4nykey@gmail.com> Date: Fri, 12 Mar 2010 18:04:46 +0100 Subject: decoder/mpcdec: fix replay gain formula with v8 "When playing musepack files with mpd v0.15.8, rg seems to have no effect. Using sample file below, mpd says 'computing ReplayGain album scale with gain 122.879997, peak 0.549150'. One thing though, if I build mpd against old libmpcdec-1.2.6, rg works as expected: 'computing ReplayGain album scale with gain 16.820000, peak 0.099765'" --- src/decoder/mpcdec_plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/decoder') diff --git a/src/decoder/mpcdec_plugin.c b/src/decoder/mpcdec_plugin.c index b3582c689..72a516f22 100644 --- a/src/decoder/mpcdec_plugin.c +++ b/src/decoder/mpcdec_plugin.c @@ -24,6 +24,7 @@ #include #else #include +#include #endif #include @@ -209,10 +210,17 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is) } replay_gain_info = replay_gain_info_new(); +#ifdef MPC_IS_OLD_API replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = info.gain_album * 0.01; replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = info.peak_album / 32767.0; replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = info.gain_title * 0.01; replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = info.peak_title / 32767.0; +#else + replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = MPC_OLD_GAIN_REF - (info.gain_album / 256.); + replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = pow(10, info.peak_album / 256. / 20) / 32767; + replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = MPC_OLD_GAIN_REF - (info.gain_title / 256.); + replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = pow(10, info.peak_title / 256. / 20) / 32767; +#endif decoder_initialized(mpd_decoder, &audio_format, is->seekable, -- cgit v1.2.3