From d1748031d9a296056f92f9aadc8abe76ae74e7bd Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 10 Jul 2014 20:02:13 +0200 Subject: fixed "play" action when nothing is selected and playback is stopped (bug #1148) --- plugins/gtkui/callbacks.c | 3 +++ plugins/hotkeys/hotkeys.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 913a17fb..981e2a63 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -153,6 +153,9 @@ on_playbtn_clicked (GtkButton *button, cur = deadbeef->plt_get_cursor (plt, PL_MAIN); deadbeef->plt_unref (plt); } + if (cur == -1) { + cur = 0; + } deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } } diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index db270d1c..230c01b9 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -620,6 +620,9 @@ action_play_cb (struct DB_plugin_action_s *action, int ctx) { cur = deadbeef->plt_get_cursor (plt, PL_MAIN); deadbeef->plt_unref (plt); } + if (cur == -1) { + cur = 0; + } deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, cur, 0); } return 0; -- cgit v1.2.3