Skip to content

Fix/cue playback failure handling#515

Open
markojurkovic wants to merge 2 commits into
losnoco:mainfrom
markojurkovic:fix/cue-playback-failure-handling
Open

Fix/cue playback failure handling#515
markojurkovic wants to merge 2 commits into
losnoco:mainfrom
markojurkovic:fix/cue-playback-failure-handling

Conversation

@markojurkovic

Copy link
Copy Markdown
Contributor

Summary

Improve failure handling for CUE and other multi-track sources so recoverable decoder behavior does not produce false track errors, while genuinely failed sources are skipped efficiently.

Changes

  • Associate playback errors with the buffer chain’s originating track instead of whichever track is current when an asynchronous callback arrives.
  • Ignore superseded seek failures and clear recoverable seek errors when the decoder subsequently produces valid audio.
  • Treat fragment URLs as logical tracks backed by the same underlying resource.
  • After an underlying resource fails to open, skip repeated decoder probes for its remaining logical tracks.
  • Mark skipped tracks appropriately while searching for the next playable source.
  • Publish a stream-change notification only after a fallback stream opens successfully.

Result

CUE tracks that recover from an imperfect seek are no longer incorrectly marked as failed. When a shared multi-track source genuinely cannot be opened, Cog avoids repeating the same expensive probe for every track and advances to the next playable source without presenting failed fallbacks as the current track.

Verification

  • Both commits build successfully in Debug for arm64 with code signing disabled.
  • git diff --check main...fix/cue-playback-failure-handling passes.

Suggested manual checks

  • Play a valid multi-track CUE source and confirm recoverable seeks do not mark tracks as failed.
  • Trigger rapid track transitions and confirm late errors remain attached to their originating tracks.
  • Queue an unopenable multi-track source followed by a valid track.
  • Confirm Cog skips the failed source without probing every logical track and begins playing the valid fallback.
  • Confirm failed intermediate tracks are not briefly presented as the current stream.

Marko Jurkovic added 2 commits July 19, 2026 14:07
Keep late playback errors attached to their originating track and ignore superseded or recoverable seek failures when valid audio follows.
Treat fragment URLs from the same underlying resource as one failed source, avoid repeatedly opening each logical track, and publish only the first fallback stream that opens successfully.
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