Skip to content

fix(playback): resume interrupted streams - #1005

Open
tofuliang wants to merge 1 commit into
supersonic-app:mainfrom
tofuliang:fix/playback-network-resume
Open

fix(playback): resume interrupted streams#1005
tofuliang wants to merge 1 commit into
supersonic-app:mainfrom
tofuliang:fix/playback-network-resume

Conversation

@tofuliang

Copy link
Copy Markdown
Contributor

Description

Preserve the current track and playback position when an MPV stream is interrupted by a network error.

Previously, MPV transitioning to Stopped cleared the current queue index. Pressing Play then restarted the first queue item from 0:00.

Changes

  • Detect MPV END_FILE errors and premature EOF events.
  • Add an optional player error callback.
  • Preserve the current queue index and last observed position after an error.
  • Resume the same track from that position when Play is pressed.
  • Keep explicit Stop and normal end-of-track behavior unchanged.
  • Report the interrupted state as paused.

Testing

  • Added tests for error recovery, premature EOF, backward seeking, explicit Stop, queue preservation, and paused-state reporting.
  • go test ./...
  • go test -race ./backend/player/mpv ./backend
  • Manually verified by interrupting a live TCP stream and restoring the connection.

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