aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2009-01-23 18:50:13 +0100
committerMax Kellermann <max@duempel.org>2009-01-24 13:10:02 +0100
commit82df4cb2b0dfdb58e7b459bcf5cf2a286c8c640a (patch)
treef4a42b96f2c8b81b74ea353fab49bfbff8a6ae29 /src
parent84b63c45fa486c6e4487a425778e6b889b6e62e4 (diff)
downloadmpd-82df4cb2b0dfdb58e7b459bcf5cf2a286c8c640a.tar.gz
mpd-82df4cb2b0dfdb58e7b459bcf5cf2a286c8c640a.tar.xz
mpd-82df4cb2b0dfdb58e7b459bcf5cf2a286c8c640a.zip
modplug: change settings before loading a file
alternative settings must be set before the file is loaded, otherwise they won't be respected.
Diffstat (limited to 'src')
-rw-r--r--src/decoder/modplug_plugin.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c
index e02282c04..f21f4e7a7 100644
--- a/src/decoder/modplug_plugin.c
+++ b/src/decoder/modplug_plugin.c
@@ -91,12 +91,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
g_warning("could not load stream\n");
return;
}
- f = ModPlug_Load(bdatas->data, bdatas->len);
- g_byte_array_free(bdatas, TRUE);
- if (!f) {
- g_warning("could not decode stream\n");
- return;
- }
+
ModPlug_GetSettings(&settings);
/* alter setting */
settings.mResamplingMode = MODPLUG_RESAMPLE_FIR; /* RESAMP */
@@ -106,6 +101,13 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
/* insert more setting changes here */
ModPlug_SetSettings(&settings);
+ f = ModPlug_Load(bdatas->data, bdatas->len);
+ g_byte_array_free(bdatas, TRUE);
+ if (!f) {
+ g_warning("could not decode stream\n");
+ return;
+ }
+
audio_format.bits = 16;
audio_format.sample_rate = 44100;
audio_format.channels = 2;