pcm_utils: check pcm_convert()==0

It is illegal to pass an empty audio buffer around.  pcm_resample()
sometimes seems to result in 0 samples, maybe related to
libsamplerate.  To work around that problem, add special checks after
both pcm_convert() invocations.  Removed the pcm_resample()==0 checks
from pcm_convert().
This commit is contained in:
Max Kellermann
2008-12-24 03:08:39 +01:00
parent d2d11d70a8
commit 0d9d82a932
3 changed files with 16 additions and 5 deletions

View File

@@ -379,8 +379,6 @@ pcm_convert_16(const struct audio_format *src_format,
dest_format->sample_rate,
dest_buffer, dest_size,
&state->resample);
if (len == 0)
exit(EXIT_FAILURE);
}
return len;
@@ -421,8 +419,6 @@ pcm_convert_24(const struct audio_format *src_format,
dest_format->sample_rate,
(int32_t*)dest_buffer, dest_size,
&state->resample);
if (len == 0)
exit(EXIT_FAILURE);
}
return len;