Mercurial > audlegacy
diff src/audacious/input.c @ 3170:603577228518 trunk
get_current_input_playback() cleanups.
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Thu, 26 Jul 2007 14:22:26 -0500 |
parents | 56121fc7a4cb |
children | 93d2cda7e072 |
line wrap: on
line diff
--- a/src/audacious/input.c Wed Jul 25 19:10:53 2007 -0500 +++ b/src/audacious/input.c Thu Jul 26 14:22:26 2007 -0500 @@ -1,5 +1,5 @@ /* Audacious - Cross-platform multimedia player - * Copyright (C) 2005-2006 Audacious development team + * Copyright (C) 2005-2007 Audacious development team * * Based on BMP: * Copyright (C) 2003-2004 BMP development team @@ -511,14 +511,16 @@ void input_set_eq(gint on, gfloat preamp, gfloat * bands) { + InputPlayback *playback; + if (!ip_data.playing) return; - if (!get_current_input_playback()) + if ((playback = get_current_input_playback()) == NULL) return; - if (get_current_input_playback()->plugin->set_eq) - get_current_input_playback()->plugin->set_eq(on, preamp, bands); + if (playback->plugin->set_eq) + playback->plugin->set_eq(on, preamp, bands); } void @@ -764,14 +766,15 @@ void input_get_volume(gint * l, gint * r) { + InputPlayback *playback; + *l = -1; *r = -1; if (playback_get_playing()) { - if (get_current_input_playback() && - get_current_input_playback()->plugin->get_volume && - get_current_input_playback()->plugin->get_volume(l, r)) { + if ((playback = get_current_input_playback()) != NULL && + playback->plugin->get_volume && + playback->plugin->get_volume(l, r)) return; - } } output_get_volume(l, r); } @@ -779,19 +782,21 @@ void input_set_volume(gint l, gint r) { + InputPlayback *playback; + gint h_vol[2]; + + h_vol[0] = l; + h_vol[1] = r; + hook_call("volume set", h_vol); if (playback_get_playing() && - get_current_input_playback() && - get_current_input_playback()->plugin->set_volume && - get_current_input_playback()->plugin->set_volume(l, r)) + (playback = get_current_input_playback()) != NULL && + playback->plugin->set_volume && + playback->plugin->set_volume(l, r)) return; output_set_volume(l, r); - - h_vol[0] = l; - h_vol[1] = r; - hook_call("volume set", h_vol); } void