From faffc4a53ba096d8aea3f1c729b9251ce6dba9d0 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 8 Jul 2014 20:30:07 +0200 Subject: fixed unpausing of currently paused track using "play" action --- main.c | 11 ++--------- plugins/gtkui/callbacks.c | 3 ++- plugins/gtkui/fileman.c | 2 +- plugins/hotkeys/hotkeys.c | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/main.c b/main.c index 8cc3e63a..dbaed838 100644 --- a/main.c +++ b/main.c @@ -344,7 +344,7 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi plt_add_files_end (curr_plt, 0); plt_unref (curr_plt); if (!queue) { - messagepump_push (DB_EV_PLAY_CURRENT, 0, 1, 0); + messagepump_push (DB_EV_PLAY_NUM, 0, 0, 0); return 2; // don't reload playlist at startup } } @@ -571,14 +571,7 @@ player_mainloop (void) { } break; case DB_EV_PLAY_CURRENT: - if (p1) { - output->stop (); - pl_playqueue_clear (); - streamer_set_nextsong (0, 1); - } - else { - streamer_play_current_track (); - } + streamer_play_current_track (); break; case DB_EV_PLAY_NUM: output->stop (); diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 06daf072..913a17fb 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -127,6 +127,7 @@ on_playbtn_clicked (GtkButton *button, if (cur != -1) { ddb_playItem_t *it = deadbeef->plt_get_item_for_idx (plt, cur, PL_MAIN); ddb_playItem_t *it_playing = deadbeef->streamer_get_playing_track (); + if (it) { deadbeef->pl_item_unref (it); } @@ -137,7 +138,7 @@ on_playbtn_clicked (GtkButton *button, deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } else { - deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0); + deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 0, 0); } } else { diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c index 24b9ca8a..7ae71006 100644 --- a/plugins/gtkui/fileman.c +++ b/plugins/gtkui/fileman.c @@ -113,7 +113,7 @@ open_files_worker (void *data) { deadbeef->pl_set_cursor (PL_MAIN, 0); deadbeef->conf_save (); deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); - deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0); + deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, 0, 0); } void diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index 4315602d..db270d1c 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -605,7 +605,7 @@ action_play_cb (struct DB_plugin_action_s *action, int ctx) { deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } else { - deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0); + deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 0, 0); } } else { -- cgit v1.2.3