[vlc-devel] CUE File Playlist track data gets overwritten when track is played

Nils Le Roux nilsleroux at gmail.com
Tue Aug 2 21:43:51 CEST 2016

Hi there,
I'm completely new to VLC source code, so let me first appologize if my
explanations looks confused or inaccurate to you.

I'm digging a bit into it, trying to understand where this 6 years old bug
comes from: https://trac.videolan.org/vlc/ticket/4143#no1 . It's quite easy
to reproduce: just take a FLAC file (with metadata in it) and the
corresponding CUE file (with song names and timepoints in it). The CUE file
is correctly loaded, you can see the expected songs in the playlist.
However, as soon as you change the track in the playlist, the track name
gets overridden by the FLAC metadata (as if you opened the FLAC file
directly). One would have expected the song name not to change, that is to
say to remain the same mentioned in the CUE file.

>From what I understood, CUE files are loaded and parsed using a LUA module,
then injected softly into the playlist. From this point, VLC completely
looses track on the CUE file and just knows the FLAC file and its
timepoints. As soon as the playlist thread switches the input, the new
input kind of reloads metadata from the "master input" (don't know exactly
what that is, I assume it's the FLAC file in our case) at the end of the
thread initialization (see *input.c*:*1342*, Init function). That's our
issue: we would expect it either not to reload the metadata at all, or to
reload them from the CUE file, not the FLAC file. We can easily prove this
by commenting out the first "InputSourceMeta" call in *input.c* Init
function (:*1342*). Removing this line seems to fix this issue (but will
most likely cause unexpected side effects in a lot of other cases).

What would be an acceptable fix according to you? I can see at least two
solutions (not sure I'm really able to implement any of them, but I'll
definitely give it a try though):

   - Make the playlist aware of the CUE file and reload metadata from this
   CUE file.
   - Find some (hacky?) way to force VLC not to reload the metadata in this
   specific case? (But which case exactly?)

I find none of these solutions completely satisfying. Any better idea would
be appreciated.

Thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160802/df072b53/attachment.html>

More information about the vlc-devel mailing list