{mixer,output}/pulse: move code to LogPulseError()

This commit is contained in:
Max Kellermann
2014-12-29 22:42:52 +01:00
parent 6a0a5f9693
commit 99e6409a67
5 changed files with 71 additions and 13 deletions

View File

@@ -21,6 +21,7 @@
#include "PulseOutputPlugin.hxx"
#include "lib/pulse/Domain.hxx"
#include "lib/pulse/Error.hxx"
#include "lib/pulse/LogError.hxx"
#include "../OutputAPI.hxx"
#include "mixer/MixerList.hxx"
#include "mixer/plugins/PulseMixerPlugin.hxx"
@@ -618,9 +619,8 @@ pulse_output_close(AudioOutput *ao)
o = pa_stream_drain(po->stream,
pulse_output_stream_success_cb, po);
if (o == nullptr) {
FormatWarning(pulse_domain,
"pa_stream_drain() has failed: %s",
pa_strerror(pa_context_errno(po->context)));
LogPulseError(po->context,
"pa_stream_drain() has failed");
} else
pulse_wait_for_operation(po->mainloop, o);
}
@@ -797,9 +797,7 @@ pulse_output_cancel(AudioOutput *ao)
o = pa_stream_flush(po->stream, pulse_output_stream_success_cb, po);
if (o == nullptr) {
FormatWarning(pulse_domain,
"pa_stream_flush() has failed: %s",
pa_strerror(pa_context_errno(po->context)));
LogPulseError(po->context, "pa_stream_flush() has failed");
pa_threaded_mainloop_unlock(po->mainloop);
return;
}