New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VideoPlayer] Flush streamplayers if abort is requested #15459
Conversation
This is not correct. CVideoPlayer::OnExit calls CloseStream of subplayers. An extra flush should not be required. |
void CVideoPlayer::FlushPlayer(bool sync) | ||
{ | ||
CLog::Log(LOGNOTICE, "CVideoPlayer::FlushPlayer()"); | ||
m_VideoPlayerAudio->Flush(sync); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those must only be called by videoplayer's thread.
VP::OnExit is not yet called, because of this the subplayers are not notified:
Stack trace:
|
It should get called right after Post backtrace of VideoPlayer thread. |
main:
VP:
VPV:
|
What I don't get clear is why m_bAbortOutput is set to false in CVideoPlayerVideo::OutputPicture. |
bWaitForBuffers should be false but it seems it is true. |
The problem is inputstream->Abort() results into CDVDInputStream::NEXTSTREAM_OPEN VP hangs here: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/VideoPlayer.cpp#L1511 |
make CDVDInputStreamNavigator::NextStream return NEXTSTREAM_NONE after Abort() was called |
This doesn't help. My keypress is after the Nextstream was selected Log:
If your internet bandwith is okish, you can reproduce on every platform with the bugsbunny iso linked above. So, id you still use kodi, you may want to try by yourself? Simply start the stream, and press x if the first frames get visible |
Can't repro here. I downloaded the linked iso. There is no legal notice. I click on start movie, the movie starts. On x it stops immediately. |
Try harder :-) For me the legal notice came only once, after that it was just skipped / not displayed (on both win and android). If your legal notice is visible every time, try to press x as late as possible in the legal notice, Issue does not appear always, but after 3, 4 times I usually get it in this state. |
The root cause is that the main thread and render thread are the same. When you hit 'x' for stop the render thread won't render anymore. The best fix is to shut down RM before VP:
|
d5bf100
to
8253050
Compare
Hi @peak3d |
Description
Flush VideoPlayer's (sub) players (video / audio / subtitle ...) when closing a stream.
Motivation and Context
I ran regulary into the situation that stopping a video stream takes long time.
In one of my DVD iso's I have to wait for example ~ 15secs if I stop playback during legal notice.
In kodi log you see this:
Reason is that sub-players are not notified that abort is requested, and e.g. VideoPlayer tries to render frames while VideoPlayer is waiting for finalization.
This PR notifies sub-players that abort is requested using Flush().
How Has This Been Tested?
Very long wait for stream termination:
Types of change