[windows] Fix CGUIMediaWindow::WaitGetDirectoryItems to leave 'wait f… #23844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…or update job finished loop' also if the update was canceled via CGUIMediaWindow::CancelUpdateItems.
Fixes #23738
Fix was confirmed working by the issue submitter.
A bit hard to explain what happened but I can try. ;-)
While the user started live TV channel playback from inside the PVR channels window, but before the channels window got deactivated (because full screen video was activated), PVR core notified a bunch async events, which lead to a refresh of the channels window list items.
In the moment, the channels window gets deactivated,
CGUIMediaWindow::CancelUpdateItems
gets called (frame 0).This then calls
m_updateEvent.Wait
. Once this wait call returns,m_updateEvent
will be reset - and this is important thing here, also if it was already set before the 'Wait' call by a job triggered byCGUIMediaWindow::WaitGetDirectoryItems
(frame 17), leading them_updateEvent.Wait
call done in a loop inCGUIMediaWindow::WaitGetDirectoryItems
never leaving that loop.Because even lower on the stack (frame 34), there is a
CGUIDialogBusy::WaitOnEvent
call which will never return in this situation, the user saw an endless busy spinner on top of the running live tv channel.Because of the async nature of the problem it was very hard to reproduce, but at the end I hacked together a special test case for that (not nice at all, but effective). :-)
If you want to understand all the details, you need at least to study the implementation of
CGUIMediaWindow::CancelUpdateItems
,CGUIMediaWindow::WaitGetDirectoryItems
andCEvent::Wait
(callingCEvent::prepReturn
where the reset of 'signalled' happens').It is also worth mentioning that this problem is not caused by the "busy dialog". This can also happen without busy dialog being involved. And the problem is not restricted to Live TV. Could happen with any kind of media window content.
I have no idea who could review this, thus setting no reviewer.
I will merge this after a week or so of inactivity.