From 6c480d7db43c592d2a174de28a00de5f2c7cf2ba Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Mar 2009 19:50:23 +0100 Subject: pulse_mixer: removed superfluous NULL checks in close() When the MPD core knows that the pulse mixer is open, pm->mainloop and pm->context must be non-NULL. --- src/mixer/pulse_mixer.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/mixer/pulse_mixer.c b/src/mixer/pulse_mixer.c index b1067ae98..7999699be 100644 --- a/src/mixer/pulse_mixer.c +++ b/src/mixer/pulse_mixer.c @@ -255,19 +255,11 @@ static void pulse_mixer_close(G_GNUC_UNUSED struct mixer *data) { struct pulse_mixer *pm=(struct pulse_mixer *) data; - if (pm->mainloop) - pa_threaded_mainloop_stop(pm->mainloop); - if (pm->context) { - pa_context_disconnect(pm->context); - pa_context_unref(pm->context); - pm->context = NULL; - } - - if (pm->mainloop) { - pa_threaded_mainloop_free(pm->mainloop); - pm->mainloop = NULL; - } + pa_threaded_mainloop_stop(pm->mainloop); + pa_context_disconnect(pm->context); + pa_context_unref(pm->context); + pa_threaded_mainloop_free(pm->mainloop); pm->online = false; } -- cgit v1.2.3