From 2e10846c5d7017ff17e0c7cd2a9deaabcd1fae4e Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Fri, 3 Jan 2020 15:06:45 +0100 Subject: [PATCH] Reset playlist on new file playback Fixes: https://github.com/xbmc/xbmc/issues/16690 Co-authored-by: Rainer Hochecker (cherry picked from commit 95889eafd6906ff23667d0c185a6c0d711d6350a) --- xbmc/PlayListPlayer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/PlayListPlayer.cpp b/xbmc/PlayListPlayer.cpp index cb7816c4a945b..ae51ed175a195 100644 --- a/xbmc/PlayListPlayer.cpp +++ b/xbmc/PlayListPlayer.cpp @@ -862,6 +862,10 @@ void PLAYLIST::CPlayListPlayer::OnApplicationMessage(KODI::MESSAGING::ThreadMess // first check if we were called from the PlayFile() function if (pMsg->lpVoid && pMsg->param2 == 0) { + // Discard the current playlist, if TMSG_MEDIA_PLAY gets posted with just a single item. + // Otherwise items may fail to play, when started while a playlist is playing. + Reset(); + CFileItem *item = static_cast(pMsg->lpVoid); g_application.PlayFile(*item, "", pMsg->param1 != 0); delete item;