Skip to content

fix: prevent audio HAL-reset heuristic from misinterpreting user seeks#2022

Merged
theovilardo merged 1 commit into
masterfrom
fix/seekbar-not-responding
May 16, 2026
Merged

fix: prevent audio HAL-reset heuristic from misinterpreting user seeks#2022
theovilardo merged 1 commit into
masterfrom
fix/seekbar-not-responding

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Prevents the DualPlayerEngine from incorrectly identifying a manual seek as a HAL offload underflow. By tracking seek timing, the engine now distinguishes between legitimate audio-sink resets and standard buffering caused by position changes, avoiding unnecessary player rebuilds that could drop pending commands.

  • Added lastSeekAtMs to track the timestamp of the most recent seek operation.
  • Implemented notifyExternalSeekInitiated() to allow the UI to flag seeks synchronously before they are dispatched to the MediaController.
  • Updated onPlaybackStateChanged logic to ignore STATE_BUFFERING events if they occur within a 1.5-second window of a seek.
  • Added onPositionDiscontinuity listener to capture and record seek events within the player engine.
  • Integrated the seek notification call in PlaybackStateHolder immediately prior to executing seekTo.

Prevents the `DualPlayerEngine` from incorrectly identifying a manual seek as a HAL offload underflow. By tracking seek timing, the engine now distinguishes between legitimate audio-sink resets and standard buffering caused by position changes, avoiding unnecessary player rebuilds that could drop pending commands.

- Added `lastSeekAtMs` to track the timestamp of the most recent seek operation.
- Implemented `notifyExternalSeekInitiated()` to allow the UI to flag seeks synchronously before they are dispatched to the `MediaController`.
- Updated `onPlaybackStateChanged` logic to ignore `STATE_BUFFERING` events if they occur within a 1.5-second window of a seek.
- Added `onPositionDiscontinuity` listener to capture and record seek events within the player engine.
- Integrated the seek notification call in `PlaybackStateHolder` immediately prior to executing `seekTo`.
@theovilardo theovilardo merged commit 4247712 into master May 16, 2026
3 of 4 checks passed
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.

1 participant