[enigma2] Fix PiG video flash when opening a child screen#1265
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem:
When a screen containing a PiG (Picture in Graphic) was visible and a child screen without a PiG was opened, a brief but visible flash occurred: the live TV video would momentarily scale to fullscreen and appear cropped inside the parent screen's PiG area before the child screen finished rendering.
Root cause:
updatePosition could not distinguish between two fundamentally different situations that both call it with disable=1:
The PiG widget's parent screen is temporarily hidden because a child screen is being pushed on top (widget still alive, will become visible again when the child closes).
The PiG widget is being destroyed because its screen is closing completely (fullscreen must be restored).
Fix:
Fullscreen restoration is moved entirely into ~eVideoWidget(). The destructor checks m_state & 1 — the flag that is set the first time updatePosition commits a position to the hardware — to confirm this widget actually controlled the decoder before writing the restore. The else branch of updatePosition (the temporary-hide path) now only clears the hardware-applied state flag and does nothing to the decoder position.