Skip to content

VPAAMP-1521: Parental control: after scrubbing back into a blocked program - #2143

Open
Vinish100 wants to merge 1 commit into
support/2.11.1_8.4_vipafrom
feature/2.11.1_8.4_vipa_VPAAMP-1521
Open

Vinish100 wants to merge 1 commit into
support/2.11.1_8.4_vipafrom
feature/2.11.1_8.4_vipa_VPAAMP-1521

Conversation

@Vinish100

@Vinish100 Vinish100 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

in the TSB and entering the PIN, the block screen stays and video never shows

Reason for change: Multi-level fix

  1. In the SetRate resume path, if the seek-while-paused first frame is pending or Pause(false) did not reach PLAYING, call NotifySpeedChanged with changeState=false and clear mPauseOnFirstVideoFrameDisp.
  2. Make InterfacePlayerRDK::Pause return false when validateStateWithMsTimeout does not reach the target. The retValue handling in SetRate already exists.
  3. Add a seekPrerollPending flag in MW to track the pipeline state. The flag is used to avoid querying stale position value from GStreamer during a preroll
    Test Procedure: As mentioned in the ticket
    Risks: Medium

AI identified residual risks

  1. Stale ASYNC_DONE: one still sitting in the bus from an earlier transition could clear the flag early. That only brings back the old behaviour for that seek.
  2. Flushing seeks only: the flag is set only for flushing seeks issued through Flush(). The appsrc-level seek in SendGstEvents (used when a pipeline is first configured) is not covered.
  3. Pause() return value: it still returns true after a real wait timeout, which I left unchanged to avoid leaving the AAMP state stuck as paused.

@Vinish100
Vinish100 requested a review from a team as a code owner October 29, 2026 13:55
@Vinish100
Vinish100 requested a balanced review from Copilot October 29, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved pause/resume races can lose resume requests or override the latest pause intent, while queued PLAYING messages can prematurely clear seek-preroll protection and re-enable stale position queries and blocking waits.

3 open issues
What changed in this PR

This PR addresses playback remaining blocked after seeking into a parental-controlled program and entering the PIN. It coordinates resume handling with first-frame delivery and suppresses potentially stale position queries during seek preroll.

Changes:

  • Cancels pending first-frame pauses on resume while deferring the PLAYING state transition.
  • Tracks seek preroll in middleware, skips blocking resume waits during preroll, and temporarily suppresses position queries.
  • Adds focused unit tests and updates test doubles for the cancellation helper.
File Description
test/​utests/​tests/​PrivAampTests/​PrivAampTests.cpp Tests cancellation of a pending first-frame pause.
test/​utests/​fakes/​FakePrivateInstanceAAMP.cpp Adds the cancellation helper stub.
test/​utests/​drm/​mocks/​aampMocks.cpp Adds the cancellation helper to DRM test doubles.
priv_aamp.h Declares and documents the cancellation helper.
priv_aamp.cpp Implements cancellation and synchronizes first-frame flag capture.
middleware/​test/​utests/​tests/​InterfacePlayerTests/​InterfacePlayerFunctionTests.cpp Tests preroll tracking, position suppression, timeout, and resume behavior.
middleware/​InterfacePlayerRDK.cpp Tracks preroll and adjusts position queries and resume waits.
middleware/​InterfacePlayerPriv.h Adds atomic preroll state and timestamp fields.
main_aamp.cpp Integrates cancellation into resume and defers state notification.

Review effort: Balanced

Comment thread priv_aamp.cpp Resolved
Comment thread middleware/InterfacePlayerRDK.cpp Resolved
Comment thread priv_aamp.cpp Resolved
@Vinish100
Vinish100 force-pushed the feature/2.11.1_8.4_vipa_VPAAMP-1521 branch 2 times, most recently from 77694f5 to 2682520 Compare October 30, 2026 05:46
@Vinish100
Vinish100 requested a balanced review from Copilot October 30, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An unqualified Ne matcher prevents unit-test compilation, while pause/resume changes can leave sidecar captions running during a pause or the stream marked paused after playback resumes.

3 open issues
3 resolved since last review

Review effort: Balanced

Comment thread main_aamp.cpp Resolved
Comment thread main_aamp.cpp Resolved
…ogram in the TSB and entering the PIN, the block screen stays and video never shows

Reason for change: Multi-level fix
1. In the SetRate resume path, if the seek-while-paused first frame is pending or Pause(false)
did not reach PLAYING, call NotifySpeedChanged with changeState=false and clear mPauseOnFirstVideoFrameDisp.
NotifyFirstVideoFrameDisplayed then moves SEEKING → PLAYING at the right time.
2. Make InterfacePlayerRDK::Pause(false) return true when when pipeline is in preroll and does not reach the target.
3. Add a seekPrerollPending flag in MW to track the pipeline state. The flag is used to avoid querying
stale position value from GStreamer during a in-flight preroll.
Test Procedure: As mentioned in the ticket
Risks: Medium

Signed-off-by: Vinish100 <vinish.balan@gmail.com>
@Vinish100
Vinish100 force-pushed the feature/2.11.1_8.4_vipa_VPAAMP-1521 branch from 2682520 to 5b0d645 Compare October 30, 2026 11:43
@Vinish100
Vinish100 requested a balanced review from Copilot October 30, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The pause-after-seek sequence can block the first-frame callback and leave playback stuck in SEEKING, while a separate race can clear a newer seek’s pending flag and expose stale positions.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment thread main_aamp.cpp
{
// A resume may have cancelled the pause on first frame of a seek while paused; keep the latest pause intent.
// The state stays SEEKING in that case and NotifyFirstVideoFrameDisplayed() will move it to PAUSED.
seekWhilePausedFramePending = aamp->RearmPauseOnFirstVideoFrame();
return rc;
}
MW_LOG_WARN("Seek preroll not completed within %d ms, resuming position queries", GST_SEEK_PREROLL_TIMEOUT_MS);
interfacePlayerPriv->gstPrivateContext->seekPrerollPending = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants