commit 601093db002025f856a835250585bc4d136ea068 from: Omar Polo date: Tue Feb 22 12:16:26 2022 UTC unify IMSG_ERR and IMSG_EOF handling IMSG_ERR needs a playlist_dropcurrent(), but otherwise is just the same as IMSG_EOF: the current song ended and we need to move forward. To unify, set current_song to NULL in playlist_dropcurrent, which make sense since right after it we're not playing anything. commit - a553fbed3ddcda1fee9838f6307fc2c6e19635db commit + 601093db002025f856a835250585bc4d136ea068 blob - ddfad3e6acc64da26cd94b36b20412021c50a9dc blob + 66d8f2f759023dee40dbee3d42f1c94cd672150b --- amused.c +++ amused.c @@ -131,12 +131,7 @@ main_dispatch_player(int sig, short event, void *d) switch (imsg.hdr.type) { case IMSG_ERR: playlist_dropcurrent(); - main_playlist_advance(); - if (play_state == STATE_PLAYING) - control_notify(NULL, IMSG_CTL_NEXT); - else - control_notify(NULL, IMSG_CTL_STOP); - break; + /* fallthrough */ case IMSG_EOF: if (repeat_one && current_song != NULL) if (main_play_song(current_song)) blob - f05614d72b861a14edba0471afbf9fe737e272d5 blob + 18d33d2a8c1d5c9f2be9475556fc3ba7578ceba0 --- playlist.c +++ playlist.c @@ -186,6 +186,7 @@ playlist_dropcurrent(void) return; free(playlist.songs[play_off]); + setsong(-1); playlist.len--; for (i = play_off; i < playlist.len; ++i)