Skip to content

RDKEMW-28182: Stop subtitle clock resync timer on READY and pipeline teardown - #691

Open
jaihere4u wants to merge 2 commits into
masterfrom
subtitle-resync-timer-lifecycle
Open

jaihere4u wants to merge 2 commits into
masterfrom
subtitle-resync-timer-lifecycle

Conversation

@jaihere4u

@jaihere4u jaihere4u commented Nov 3, 2026 •

Copy link
Copy Markdown

Jira: RDKEMW-28182

What

The 10s SynchroniseSubtitleClock periodic timer was only stopped on the PAUSED bus transition. Through READY/NULL and termPipeline() it kept firing, enqueueing worker tasks that warn on null position/source and racing resetWorkerThread().

Changes

  • HandleBusMessage: stop the resync timer on GST_STATE_READY when a subtitle source is attached
  • GstGenericPlayer::termPipeline(): cancel m_subtitleClockResyncTimer alongside the other timers
  • AttachSource: fail loudly (ERROR + no appsrc/streamInfo) when the pipeline does not expose a text-sink property, instead of silently buffering subtitle data to nowhere

L1 tests

  • READY with subtitle -> stopSubtitleClockResyncTimer
  • PAUSED with subtitle -> stopSubtitleClockResyncTimer
  • PLAYING with subtitle -> startSubtitleClockResyncTimer

Reviewed as part of the Rialto subtitle stabilization audit.

Subramanian added 2 commits November 2, 2026 22:48
The 10s SynchroniseSubtitleClock timer was only stopped on the PAUSED
state transition. Through READY/NULL and termPipeline it kept firing,
enqueueing tasks that warn on null position/source and racing the worker
thread join.

- HandleBusMessage: stop the resync timer on GST_STATE_READY when a
  subtitle source is attached
- termPipeline: cancel m_subtitleClockResyncTimer alongside the other
  timers
- AttachSource: fail loudly (no appsrc/streamInfo) when the pipeline
  does not expose a 'text-sink' property, instead of buffering subtitle
  data to nowhere
Covers READY (stop), PAUSED (stop) and PLAYING (start) transitions when
a subtitle source is attached - the READY case previously had no
coverage and the timer kept firing into teardown.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 03:53
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Pull request title must follow the pattern:
< JIRA TICKET >: < one line summary of change less than 65 characters >

Pull request description must follow the Commit message format for RDK-E:
https://etwiki.sys.comcast.net/spaces/RDKAR/pages/1407997180/Commit+Message+Format+For+RDKE

  1. Associated JIRA ticket in format : < JIRA TICKET >: < one line summary of change less than 65 characters >
  2. Detailed reason for change information
  3. Test procedure. Only references links to Jira ticket or sub tickets where test steps and references are captured.

< JIRA TICKET >: < one line summary of change less than 65 characters >
< empty line >
Reason for change:
Test Procedure: < https://ccp.sys.comcast.net/browse/JIRA TICKET/url/to/test_step_section>

@jaihere4u jaihere4u changed the title Stop subtitle clock resync timer on READY and pipeline teardown RDKEMW-28182: Stop subtitle clock resync timer on READY and pipeline teardown Nov 3, 2026

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

Shutdown still allows the subtitle timer callback to race with worker-thread reset, risking an invalid dereference, and the new READY test lacks required StrictMock expectations.

2 open issues
What changed in this PR

This PR improves subtitle lifecycle handling in the GStreamer player by stopping clock resynchronization during READY transitions and pipeline teardown, and rejecting subtitle attachment when the pipeline lacks a text sink.

Changes:

  • Stops the subtitle resync timer on READY and during termPipeline().
  • Logs an error and skips subtitle source creation when text-sink is unavailable.
  • Adds tests for subtitle timer behavior on READY, PAUSED, and PLAYING transitions.
File Description
tests/​unittests/​media/​server/​gstplayer/​genericPlayer/​tasksTests/​HandleBusMessageTest.cpp Adds subtitle timer state-transition tests.
media/​server/​gstplayer/​source/​tasks/​generic/​HandleBusMessage.cpp Stops subtitle resync on READY.
media/​server/​gstplayer/​source/​tasks/​generic/​AttachSource.cpp Rejects subtitle attachment without text-sink.
media/​server/​gstplayer/​source/​GstGenericPlayer.cpp Cancels subtitle resync during pipeline teardown.

Review effort: Balanced


clearAudioFirstFrameFallbackProbe();
stopNotifyPlaybackInfoTimer();
stopSubtitleClockResyncTimer();
EXPECT_CALL(m_gstPlayer, stopNotifyPlaybackInfoTimer());
EXPECT_CALL(m_gstPlayer, stopSubtitleClockResyncTimer());
EXPECT_CALL(*m_gstWrapper, gstMessageUnref(&m_message));
firebolt::rialto::server::tasks::generic::HandleBusMessage task{m_context, m_gstPlayer,

This branch has not been deployed

No deployments
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