VLC creates defective flac when converting from mp4
I have a mp4 that plays flawlessly in VLC 3.0.18 (Debian bookworm, x86_64), no problems with video or audio. From that mp4 I created a flac using VLC's "convert". That flac plays flawlessly in audacity and qmmp. The weird part is that this flac does not play correctly in VLC (plays only for a few seconds then jumps to end of file)! I have many flacs that I frequently listen to using VLC and I tested these after I discovered this issue - they continue to play fine. At this point I theorized that something may be amiss with the current VLC "convert". As an experiment I created the flac from the mp4 source using ffmpeg. The ffmpeg created flac plays fine in VLC! The difference between the "convert" flac and the ffmpeg flac is stark - the latter is twice as large. Without even analyzing the contents of these flac files I'm confident that the VLC convert has introduced an artifact that is tripping up VLC playback. This artifact does not trip up playback by other media players, but it is tripping up VLC playback suggesting that VLC has a sensitivity to this artifact (library issue?). ffmpeg is doing the conversion correctly (no surprise), but VLC "convert" is not.
I have some additional data. There are also discontinuities/glitches in the ffmpeg generated flacs during x86_64 VLC playback. These are not as extreme as the abort I identified above, but are noticeable and annoying. These do not occur randomly for repeated playbacks of the same flac, they always occur in the same place. It's almost as if the codec has trouble with some aspect of the waveform. As before there are no playback problems when playing these flacs via other media players. Most noteworthy is that Android VLC plays these flacs without any problems! This seems like a hint that there is something wrong with how the x86_64 VLC was built and/or the libraries it utilizes. I doubt that this is a Debian packaging issue (as such issues are often all or nothing), but I will attempt to verify by trying the official videolan VLC download.
There was no 3.0.18 tarball so I built 3.0.17.4. I can confirm that this version does not have this problem - well at least not my build - I can't speak for the videolan built binaries. I think it's clear at this point that the official (via Debian package) x86_64 VLC 3.0.18 has a defective FLAC implementation.