Resume paused ActiveAE stream while draining to avoid playback lapse #17090
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.
Description
Resolution for Issue 17080, provided by @FernetMenta.
During MPEG-TS playback, an audio stream format change, for example from 6-channel to 2 channel, can cause a lapse of up to 2 seconds where no audio will be produced by the VideoPlayer. When the format change is detected, the current stream is drained, but remains in a paused state until the drain operation is complete, causing this lapse
Motivation and Context
Since the release of Kodi 18.0, I have experienced numerous MPEG-TS programs that exhibit this behavior, primarily during commercial breaks. While the issue was generally present on specific PVR addon channels, pulling the MPEG-TS file out into the normal Videos library showed that it was not specific to just PVR addons.
Issue 17080
How Has This Been Tested?
Tested on Windows x64 using build from Kodi 18.5 release tag. Provided sample file from linked issue plays without the lapse now, and have not experienced audio lapses using PVR addon with known problematic channels.
Screenshots (if appropriate):
N/A
Types of change
Checklist:
And for once, I finally have the clang-format stuff working so I don't think I'm going to get dinged on format.
Thank you @FernetMenta for providing the solution, this has been a problem spot for me for quite some time!!