aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pq_alsa.c4
-rw-r--r--src/pq_file.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pq_alsa.c b/src/pq_alsa.c
index 2a4264e..9cee426 100644
--- a/src/pq_alsa.c
+++ b/src/pq_alsa.c
@@ -46,8 +46,8 @@ pq_cb_alsa_input(void *_state, uint8_t *out, const uint8_t *in, unsigned int in_
unsigned int num_samples = state->blk_len/2;
int rv;
rv = snd_pcm_readi(state->pcm_handle, out, num_samples);
- if (rv < 0)
- return rv;
+ if (rv <= 0)
+ return -1;
return rv * sizeof(uint16_t);
}
diff --git a/src/pq_file.c b/src/pq_file.c
index e191a0a..96f7b3f 100644
--- a/src/pq_file.c
+++ b/src/pq_file.c
@@ -39,8 +39,8 @@ pq_cb_file_input(void *_state, uint8_t *out, const uint8_t *in, unsigned int in_
struct pq_state_file *state = _state;
int rv;
rv = fread(out, state->blk_len, 1, state->fh);
- if (rv < 0)
- return rv;
+ if (rv <= 0)
+ return -1;
return rv * state->blk_len;
}