aboutsummaryrefslogtreecommitdiffstats
path: root/audio_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio_read.c')
-rw-r--r--audio_read.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/audio_read.c b/audio_read.c
index 20ac1dc..0556f13 100644
--- a/audio_read.c
+++ b/audio_read.c
@@ -237,12 +237,14 @@ unsigned long read_samples (music_in_t* musicin, short sample_buffer[2304],
fprintf (stderr, "Hit end of WAV audio data\n");
}
else if (glopts.input_select == INPUT_SELECT_VLC) {
- size_t bytes_read = vlc_in_read(sample_buffer, sizeof(short) * (int)samples_read);
- if (bytes_read == 0) {
- fprintf (stderr, "Hit end of VLC audio data\n");
+ ssize_t bytes_read = vlc_in_read(sample_buffer, sizeof(short) * (int)samples_read);
+ if (bytes_read == -1) {
+ fprintf (stderr, "VLC input error\n");
+ samples_read = 0;
+ }
+ else {
+ samples_read = bytes_read / sizeof(short);
}
-
- samples_read = bytes_read / sizeof(short);
}
/*