[VideoPlayer] Double the initial refresh rate for interlaced streams #24121
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
Switch resolution/refresh rate only once when starting the playback of interlaced video streams, instead of twice with the resulting black frames and audio drop out / pitch change.
For example, this stream has the top field first flag and is detected as interlaced by ffmpeg analysis:
Current behavior:
Initial switch to a resolution with 25Hz refresh rate, followed a few seconds later by a switch to 50Hz.
Desired behavior:
Initial switch to 50Hz. No additional resolution changes.
To accomplish that, propagate the field order information from the ffmpeg analysis results to the hints used when a stream is opened, so that VideoPlayer can double the initial refresh rate for interlaced streams.
.ts stream handling in demuxer is different to enable fast switching for PVR addons and has a complicated history (see #5487 and #3590). The consequence is that the ffmpeg analysis results are lost and this PR is unable to propagate the interlaced flags and to remove the additional resolution change.
#19983 added an exception for hevc which doesn't seem to have disturbed PVR (likely because they only stream H264?)
Addressing that / revisiting .ts stream opening is beyond the scope of this PR and close to a release is not a good time for that kind of risky changes anyway.
Motivation and context
Unnecessary resolution switch for streams detected as interlaced.
Noticed personally and was brought up in forum thread https://forum.kodi.tv/showthread.php?tid=375049
How has this been tested?
Used the sample provided by user in the forum thread.
Regression testing with other samples that are detected as unknown or progressive field order.
What is the effect on users?
Remove extra resolution change when starting playback of interlaced streams.
Except .ts
Types of change
Checklist: