From e3a56738fd347f62c6cb3d04068680141defab0a Mon Sep 17 00:00:00 2001 From: DaveTBlake Date: Fri, 27 Dec 2019 13:58:20 +0000 Subject: [PATCH] Fix calling OnPlaybackStarted twice because of race condition when stream processing is faster than the callback process --- xbmc/cores/paplayer/PAPlayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp index 5e2dca4d5d4f6..fab72723a565c 100644 --- a/xbmc/cores/paplayer/PAPlayer.cpp +++ b/xbmc/cores/paplayer/PAPlayer.cpp @@ -256,8 +256,10 @@ bool PAPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options) m_isPlaying = true; m_startEvent.Set(); - m_callback.OnPlayBackStarted(file); + // OnPlayBackStarted to be made only once.Callback processing may be slower than player process + // so clear signal flag first otherwise async stream processing could also make callback m_signalStarted = false; + m_callback.OnPlayBackStarted(file); return true; }