summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/main.c b/main.c
index 6e1ba422..356a08a6 100644
--- a/main.c
+++ b/main.c
@@ -127,7 +127,8 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi
}
if (sendback) {
playItem_t *curr = streamer_get_playing_track ();
- if (curr && curr->decoder) {
+ DB_fileinfo_t *dec = streamer_get_current_decoder ();
+ if (curr && dec) {
const char np[] = "nowplaying ";
memcpy (sendback, np, sizeof (np)-1);
pl_format_title (curr, sendback+sizeof(np)-1, sbsize-sizeof(np)+1, -1, parg);
@@ -139,7 +140,8 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi
else {
char out[2048];
playItem_t *curr = streamer_get_playing_track ();
- if (curr && curr->decoder) {
+ DB_fileinfo_t *dec = streamer_get_current_decoder ();
+ if (curr && dec) {
pl_format_title (curr, out, sizeof (out), -1, parg);
}
else {
@@ -325,11 +327,11 @@ player_mainloop (void) {
break;
case M_NEXTSONG:
p_stop ();
- pl_nextsong (1);
+ streamer_move_nextsong (1);
break;
case M_PREVSONG:
p_stop ();
- pl_prevsong ();
+ streamer_move_prevsong ();
break;
case M_PAUSESONG:
if (p_get_state () == OUTPUT_STATE_PAUSED) {
@@ -343,7 +345,7 @@ player_mainloop (void) {
break;
case M_PLAYRANDOM:
p_stop ();
- pl_randomsong ();
+ streamer_move_randomsong ();
break;
case M_PLAYLISTREFRESH:
plug_trigger_event_playlistchanged ();
@@ -532,6 +534,8 @@ main (int argc, char *argv[]) {
atexit (atexit_handler); // helps to save in simple cases, like xkill
+ plt_add (0, "Default");
+
// execute server commands in local context
int noloadpl = 0;
if (argc > 1) {
@@ -587,6 +591,8 @@ main (int argc, char *argv[]) {
pl_free ();
conf_free ();
messagepump_free ();
+ plt_free ();
+ plug_free_decoder_ids ();
sigterm_handled = 1;
fprintf (stderr, "hej-hej!\n");
return 0;