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

Bug #598641 reported by RJ Skerry-Ryan
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Albert Santoni
1.8
Fix Released
High
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)
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
Revision history for this message
Albert Santoni (gamegod) wrote :

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

Revision history for this message
Albert Santoni (gamegod) wrote :

Fixed in r2465 in 1.8.

Changed in mixxx:
status: Confirmed → Fix Committed
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5430

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.