Skip to content
Permalink
Browse files

PulseAudio: don't call pa_stream_drop() for empty pa_stream_peek().

It is now explicitly spelled out in the PulseAudio docs that one
must not call pa_stream_drop() when the buffer peeked via
pa_stream_peek() is empty.

This change fixes our calls to pa_stream_drop() to comply with the
new wording.

Fixes #1317
  • Loading branch information...
mkrautz committed Jul 23, 2014
1 parent 47d8a4f commit 63f35d6a097dcf33ad0a27d8ed90572a64cae925
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/mumble/PulseAudio.cpp
@@ -469,7 +469,9 @@ void PulseAudioSystem::read_callback(pa_stream *s, size_t bytes, void *userdata)
AudioInputPtr ai = g.ai;
PulseAudioInput *pai = dynamic_cast<PulseAudioInput *>(ai.get());
if (! pai) {
pa_stream_drop(s);
if (length > 0) {
pa_stream_drop(s);
}
pas->wakeup();
return;
}
@@ -506,7 +508,9 @@ void PulseAudioSystem::read_callback(pa_stream *s, size_t bytes, void *userdata)
}
}

pa_stream_drop(s);
if (length > 0) {
pa_stream_drop(s);
}
}

void PulseAudioSystem::write_callback(pa_stream *s, size_t bytes, void *userdata) {

0 comments on commit 63f35d6

Please sign in to comment.
You can’t perform that action at this time.