# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1185482383 -7200 # Node ID faa0b632a4f677b2e796dfa56e950341db9af269 # Parent b10e5891fa85c02adb9c0bd6582a346669181bc3# Parent 21c6e57af47008ca4c73ac6fe0ee985d18b0e814 Automated merge with ssh://mf0102@hg.atheme-project.org//hg/audacious diff -r b10e5891fa85 -r faa0b632a4f6 src/audacious/input.c --- a/src/audacious/input.c Thu Jul 26 22:39:16 2007 +0200 +++ b/src/audacious/input.c Thu Jul 26 22:39:43 2007 +0200 @@ -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 @@ -513,14 +513,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 @@ -766,14 +768,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); } @@ -781,19 +784,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 diff -r b10e5891fa85 -r faa0b632a4f6 src/audacious/playback.c --- a/src/audacious/playback.c Thu Jul 26 22:39:16 2007 +0200 +++ b/src/audacious/playback.c Thu Jul 26 22:39:43 2007 +0200 @@ -148,17 +148,18 @@ void playback_pause(void) { + InputPlayback *playback; + if (!playback_get_playing()) return; - if (!get_current_input_playback()) + if ((playback = get_current_input_playback()) == NULL) return; ip_data.paused = !ip_data.paused; - if (get_current_input_playback()->plugin->pause) - get_current_input_playback()->plugin->pause(get_current_input_playback(), - ip_data.paused); + if (playback->plugin->pause) + playback->plugin->pause(playback, ip_data.paused); if (ip_data.paused) hook_call("playback pause", NULL); @@ -176,23 +177,26 @@ void playback_stop(void) { - if (ip_data.playing && get_current_input_playback()) { + InputPlayback *playback; - if (playback_get_paused()) { + if (ip_data.playing && (playback = get_current_input_playback()) != NULL) + { + if (playback_get_paused() == TRUE) + { output_flush(get_written_time()); /* to avoid noise */ playback_pause(); } ip_data.playing = FALSE; - if (get_current_input_playback()->plugin->stop) - get_current_input_playback()->plugin->stop(get_current_input_playback()); + if (playback->plugin->stop) + playback->plugin->stop(playback); free_vis_data(); ip_data.paused = FALSE; - g_free(get_current_input_playback()->filename); - g_free(get_current_input_playback()); + g_free(playback->filename); + g_free(playback); set_current_input_playback(NULL); } diff -r b10e5891fa85 -r faa0b632a4f6 src/audacious/ui_main.c --- a/src/audacious/ui_main.c Thu Jul 26 22:39:16 2007 +0200 +++ b/src/audacious/ui_main.c Thu Jul 26 22:39:43 2007 +0200 @@ -2984,14 +2984,9 @@ mainwin_idle_func(gpointer data) { static gint count = 0; - gint time = 0; - - switch((time = playback_get_time())) - { - default: - input_update_vis(time); - /* nothing at this time */ - } + gint time = playback_get_time(); + + input_update_vis(time); GDK_THREADS_ENTER(); diff -r b10e5891fa85 -r faa0b632a4f6 src/audacious/ui_playlist.c --- a/src/audacious/ui_playlist.c Thu Jul 26 22:39:16 2007 +0200 +++ b/src/audacious/ui_playlist.c Thu Jul 26 22:39:43 2007 +0200 @@ -909,7 +909,8 @@ dialog = make_filebrowser(title, FALSE); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), cfg.playlist_path); - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); + if (default_filename) + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); /* centering */ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)