Merge tag 'v0.18.13'

This commit is contained in:
Max Kellermann
2014-08-31 15:01:12 +02:00
6 changed files with 52 additions and 11 deletions

View File

@@ -825,6 +825,7 @@ alsa_play(AudioOutput *ao, const void *chunk, size_t size,
{
AlsaOutput *ad = (AlsaOutput *)ao;
assert(size > 0);
assert(size % ad->in_frame_size == 0);
if (ad->must_prepare) {
@@ -838,12 +839,22 @@ alsa_play(AudioOutput *ao, const void *chunk, size_t size,
}
const auto e = ad->pcm_export->Export({chunk, size});
if (e.size == 0)
/* the DoP (DSD over PCM) filter converts two frames
at a time and ignores the last odd frame; if there
was only one frame (e.g. the last frame in the
file), the result is empty; to avoid an endless
loop, bail out here, and pretend the one frame has
been played */
return size;
chunk = e.data;
size = e.size;
assert(size % ad->out_frame_size == 0);
size /= ad->out_frame_size;
assert(size > 0);
while (true) {
snd_pcm_sframes_t ret = ad->writei(ad->pcm, chunk, size);

View File

@@ -724,6 +724,8 @@ oss_output_play(AudioOutput *ao, const void *chunk, size_t size,
OssOutput *od = (OssOutput *)ao;
ssize_t ret;
assert(size > 0);
/* reopen the device since it was closed by dropBufferedAudio */
if (od->fd < 0 && !oss_reopen(od, error))
return 0;
@@ -734,6 +736,8 @@ oss_output_play(AudioOutput *ao, const void *chunk, size_t size,
size = e.size;
#endif
assert(size > 0);
while (true) {
ret = write(od->fd, chunk, size);
if (ret > 0) {