Skip to content

fix: songs cut off early when RSS duration is shorter than actual audio#21

Merged
guptarohit merged 1 commit intomainfrom
fix/songs-not-finishing
Mar 14, 2026
Merged

fix: songs cut off early when RSS duration is shorter than actual audio#21
guptarohit merged 1 commit intomainfrom
fix/songs-not-finishing

Conversation

@guptarohit
Copy link
Copy Markdown
Owner

Problem

Songs stop playing before they finish when the RSS itunes:duration
metadata is shorter than the actual MP3 audio length. The playback loop
had a hard stop condition that fired as soon as display_position
exceeded audio_duration_sec, killing the audio prematurely.

Fix

Remove the hard stop (if display_position >= audio_duration_sec { break; }).
Playback now ends only when:

  • The decoder reaches true end-of-stream (sink.empty())
  • The user presses q
  • The user seeks past the end

The progress bar display is clamped to audio_duration_sec so it
doesn't visually overflow past 100% on episodes where actual audio
exceeds RSS metadata duration.

Fixes #1

Remove the hard stop that killed playback when display_position exceeded
audio_duration_sec (sourced from RSS itunes:duration metadata). Playback
now ends only when the decoder reaches true EOF (sink.empty()) or the
user quits. Progress bar is clamped to audio_duration_sec to prevent
visual overflow on episodes where actual audio exceeds RSS metadata.

Fixes #1
@guptarohit guptarohit merged commit f73f532 into main Mar 14, 2026
7 checks passed
@guptarohit guptarohit mentioned this pull request Mar 14, 2026
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.

songs do not finish

1 participant