decoder_internal: decoder_input_buffer() returns bool

This fixes a regression: a boolean value was returned from
decoder_input_buffer(), but the caller chose to do a "<= 0"
comparison.
This commit is contained in:
Max Kellermann 2009-12-15 22:24:00 +01:00
parent b12072e6d9
commit 3d95226f2b

View File

@ -34,16 +34,16 @@
* calling input_stream_buffer(). We shouldn't hold the lock during a
* potentially blocking operation.
*/
static int
static bool
decoder_input_buffer(struct decoder_control *dc, struct input_stream *is)
{
int ret;
decoder_unlock(dc);
ret = input_stream_buffer(is) > 0;
ret = input_stream_buffer(is);
decoder_lock(dc);
return ret;
return ret > 0;
}
/**
@ -57,7 +57,7 @@ need_chunks(struct decoder_control *dc, struct input_stream *is, bool do_wait)
dc->command == DECODE_COMMAND_SEEK)
return dc->command;
if ((is == NULL || decoder_input_buffer(dc, is) <= 0) && do_wait) {
if ((is == NULL || !decoder_input_buffer(dc, is)) && do_wait) {
decoder_wait(dc);
player_signal();