Skip to content

Fix playlist total duration stuck at 0M 00S - #11

Open
alexeevdv wants to merge 1 commit into
lord3nd3r:masterfrom
alexeevdv:fix/playlist_duration
Open

alexeevdv wants to merge 1 commit into
lord3nd3r:masterfrom
alexeevdv:fix/playlist_duration

Conversation

@alexeevdv

Copy link
Copy Markdown

Summary

  • Playlist totals stayed at 0M 00S because track lengths were probed with QMediaPlayer. On the Qt FFmpeg backend, duration() is often still 0 when LoadedMedia fires, and the probe moved on before a real value arrived.
  • Probe lengths with TagLib instead (mediaLengthMs, Fast header read), one file per event-loop tick, so totals update without depending on Multimedia/FFmpeg timing.
  • Update the duration-probe test to use valid MPEG frames and cover cancel/completion; include QMediaMetaData directly in winamp_window.h after removing it from playlist.h.

Test plan

  • Add several local MP3/FLAC/Ogg tracks and confirm the playlist footer shows a non-zero total (not 0M 00S)
  • Restart with a saved playlist and confirm lengths fill in after restore
  • Confirm remote/stream entries are skipped and do not break the total
  • Run playlist_tests (especially testDurationProbeOneAtATime)

Before:
Screenshot from 2026-11-17 12-35-19

After:
Screenshot from 2026-11-17 12-35-31

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