FLAC, Ogg, M4A, WAV durations are reset to 0:00 on track load

Bug #598641 reported by RJ Skerry-Ryan on 2010-06-25
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Albert Santoni
Albert Santoni

Bug Description

Bill Good reported this in IRC: Since lp:mixxx/1.8 r2425 if you load a FLAC/WAV/Ogg/M4A file to a player, its duration is set to 0, whereas after library scan it has the correct duration.

Here is why:

In SoundSourceProxy::open()

+ int retVal = m_pSoundSource->open();
+ //Update some metadata (currently only the duration)
+ //after a song is open()'d. Eg. We don't know the length
+ //of VBR MP3s until we've seeked through and counted all
+ //the frames. We don't do that in ParseHeader() to keep
+ //library scanning fast.
+ m_pTrack->setDuration(m_pSoundSource->getDuration());

Yet SoundSourceMP3 is the only sound source that will set its own duration on an open() alone. All other SoundSources only set their duration on a parseHeader().

We either need to make all soundsource's parseHeader() on open() in order to have the correct duration, hack it to only update the duration if the duration is not 0, or update each soundsource to setDuration in open().

Related branches

RJ Skerry-Ryan (rryan) on 2010-06-25
Changed in mixxx:
assignee: nobody → Albert Santoni (gamegod)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 1.8.0
Changed in mixxx:
milestone: 1.8.0 → none
Albert Santoni (gamegod) wrote :

I'm just going to change this code to be something like:
if (m_pTrack->getDuration() == 0)

Albert Santoni (gamegod) wrote :

Fixed in r2465 in 1.8.

Changed in mixxx:
status: Confirmed → Fix Committed

Easy there, cowboy. You broke the VBR duration handling with that fix. I just committed a fix for /that/ in 1.8 r2468. (You I guess forgot that VBR duration is set to -1 on first load, so I just needed to change == 0 to <= 0 and all is well.)

RJ Skerry-Ryan (rryan) on 2010-10-05
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers