Commit 24d4c2df authored by Max Kellermann's avatar Max Kellermann

modplug: use only decoder_read(), not input_stream_read()

You are allowed to call decoder_read() with decoder==NULL. It is a convenience function provided by the decoder API. Don't manually fall back to input_stream_read().
parent e6cb939a
......@@ -48,11 +48,7 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is
data = g_malloc(MODPLUG_READ_BLOCK);
total_len = 0;
do {
if (decoder) {
ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
} else {
ret = input_stream_read(is, data, MODPLUG_READ_BLOCK);
}
ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
if (ret > 0) {
g_byte_array_append(bdatas, data, ret);
total_len += ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment