bah, forgot that libsamplerate doesn't check for errors

This commit is contained in:
Bill Currie 2010-08-13 01:48:48 +00:00 committed by Jeff Teunissen
parent 54fc922f6c
commit cc697236e5
4 changed files with 4 additions and 4 deletions

View file

@ -344,7 +344,7 @@ flac_stream_read (void *file, float **buf)
if (!res) { if (!res) {
stream->error = 1; stream->error = 1;
return -1; return 0;
} }
*buf = ff->buffer; *buf = ff->buffer;
return ff->size; return ff->size;

View file

@ -109,7 +109,7 @@ midi_stream_read (void *file, float **buf)
res = WildMidi_GetOutput (mf->handle, (char *)data, size); res = WildMidi_GetOutput (mf->handle, (char *)data, size);
if (res <= 0) { if (res <= 0) {
stream->error = 1; stream->error = 1;
return res; return 0;
} }
res /= CHANNELS * WIDTH; res /= CHANNELS * WIDTH;
SND_Convert (data, mf->data, res, CHANNELS, WIDTH); SND_Convert (data, mf->data, res, CHANNELS, WIDTH);

View file

@ -230,7 +230,7 @@ vorbis_stream_read (void *file, float **buf)
res = vorbis_read (vf->vf, vf->data, FRAMES, &stream->wavinfo); res = vorbis_read (vf->vf, vf->data, FRAMES, &stream->wavinfo);
if (res <= 0) { if (res <= 0) {
stream->error = 1; stream->error = 1;
return res; return 0;
} }
*buf = vf->data; *buf = vf->data;
return res; return res;

View file

@ -114,7 +114,7 @@ wav_stream_read (void *file, float **buf)
res = Qread (wf->file, data, len); res = Qread (wf->file, data, len);
if (res <= 0) { if (res <= 0) {
stream->error = 1; stream->error = 1;
return res; return 0;
} }
res /= (info->channels * info->width); res /= (info->channels * info->width);
SND_Convert (data, wf->data, res, info->channels, info->width); SND_Convert (data, wf->data, res, info->channels, info->width);