Commit 3d95226f authored by Max Kellermann's avatar Max Kellermann

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