diff options
author | Max Kellermann <max@duempel.org> | 2013-01-24 19:14:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-26 01:24:01 +0100 |
commit | 0273cd44b0b50d5d320ce88cc1472e0d8ee8e529 (patch) | |
tree | 7c493850ab07deddd637ca0b5e8b3476e40a68fc /src/decoder/modplug_decoder_plugin.c | |
parent | 3203a7dd8ce8db6afcc54d68d63b4f4af7dc4c7f (diff) | |
download | mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.tar.gz mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.tar.xz mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.zip |
input_stream: forward-declare the struct
Hide the definition from C code, to prepare the transition to C++.
Diffstat (limited to 'src/decoder/modplug_decoder_plugin.c')
-rw-r--r-- | src/decoder/modplug_decoder_plugin.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/decoder/modplug_decoder_plugin.c b/src/decoder/modplug_decoder_plugin.c index 21ee79e7e..bc3d81767 100644 --- a/src/decoder/modplug_decoder_plugin.c +++ b/src/decoder/modplug_decoder_plugin.c @@ -41,19 +41,21 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is GByteArray *bdatas; size_t ret; - if (is->size == 0) { + const goffset size = input_stream_get_size(is); + + if (size == 0) { g_warning("file is empty"); return NULL; } - if (is->size > MODPLUG_FILE_LIMIT) { + if (size > MODPLUG_FILE_LIMIT) { g_warning("file too large"); return NULL; } //known/unknown size, preallocate array, lets read in chunks - if (is->size > 0) { - bdatas = g_byte_array_sized_new(is->size); + if (size > 0) { + bdatas = g_byte_array_sized_new(size); } else { bdatas = g_byte_array_sized_new(MODPLUG_PREALLOC_BLOCK); } @@ -126,7 +128,8 @@ mod_decode(struct decoder *decoder, struct input_stream *is) assert(audio_format_valid(&audio_format)); decoder_initialized(decoder, &audio_format, - is->seekable, ModPlug_GetLength(f) / 1000.0); + input_stream_is_seekable(is), + ModPlug_GetLength(f) / 1000.0); do { ret = ModPlug_Read(f, audio_buffer, MODPLUG_FRAME_SIZE); |