summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-monitor.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-06-26 01:35:56 +0200
committerMichal Ratajsky <[email protected]>2014-06-26 01:35:56 +0200
commitf235385f34c81d4cd9092b94cb24670eb25421fa (patch)
tree489c2b9549302493da9b2d56b92aa4613722a90a /backends/pulse/pulse-monitor.c
parent0362ccf20d51fa27d7febd0e6c0fa368f2f9e663 (diff)
downloadlibmatemixer-f235385f34c81d4cd9092b94cb24670eb25421fa.tar.bz2
libmatemixer-f235385f34c81d4cd9092b94cb24670eb25421fa.tar.xz
Minor fixes
Diffstat (limited to 'backends/pulse/pulse-monitor.c')
-rw-r--r--backends/pulse/pulse-monitor.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/backends/pulse/pulse-monitor.c b/backends/pulse/pulse-monitor.c
index 21613d0..4b83368 100644
--- a/backends/pulse/pulse-monitor.c
+++ b/backends/pulse/pulse-monitor.c
@@ -149,7 +149,7 @@ pulse_monitor_disable (PulseMonitor *monitor)
gboolean
pulse_monitor_is_enabled (PulseMonitor *monitor)
{
- g_return_if_fail (PULSE_IS_MONITOR (monitor));
+ g_return_val_if_fail (PULSE_IS_MONITOR (monitor), FALSE);
return monitor->priv->enabled;
}
@@ -171,7 +171,7 @@ pulse_monitor_update_index (PulseMonitor *monitor,
if (pulse_monitor_is_enabled (monitor)) {
pulse_monitor_disable (monitor);
- /* Unset the Pulse stream to let enable recreate it */
+ /* Unset the Pulse stream to let enabling recreate it */
g_clear_pointer (&monitor->priv->stream, pa_stream_unref);
pulse_monitor_enable (monitor);
@@ -247,13 +247,9 @@ static void
monitor_read_cb (pa_stream *stream, size_t length, void *userdata)
{
const void *data;
- int ret;
- ret = pa_stream_peek (stream, &data, &length);
- if (ret < 0) {
- g_debug ("Failed to read PulseAudio stream data: %s", pa_strerror (ret));
+ if (pa_stream_peek (stream, &data, &length) < 0)
return;
- }
if (data) {
gdouble v = ((const gfloat *) data)[length / sizeof (gfloat) - 1];