clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.67k stars 670 forks source link

FLAC files with a METADATA padding block of length 0 will not play #5012

Open HarmtH opened 8 years ago

HarmtH commented 8 years ago

Some of the FLAC files in my music collection failed to play with Clementine. This is an understatement: clicking on 'Edit track information...' on these files did not even show the metadata. Other players played the files fine and showed the metadata.

Looking at the files with metaflac --list $filename, all the failing files have the following in common:

METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 0

While the files that did load and did show the metadata had a length > 0

I tried with the version included in Ubuntu 15.04 and with the Git master:

clementine 1.2.3+dfsg-2build1 (Ubuntu 15.04) As explained above, does not play and does not show metadata.

Version 1.2.3-1308-g5257922 (Git master) Files DO play, but no metadata shown.

M5oul commented 8 years ago

I encouter same issue.

nepella commented 8 years ago

I had the same problem. Programs using libFLAC often insert padding blocks when editing metadata to avoid rewriting the whole file. (When using metaflac, you can disable this behavior by passing --dont-use-padding.) I was getting nowhere tracking down the problem in Clementine—the issue is probably in a library somewhere—so I just stripped the padding out of my FLACs:

#!/bin/bash
shopt -s globstar
for i in ~/music/**/*.flac; do
    # Check first to avoid needlessly touching the timestamp.
    if [ "$(metaflac --list --block-type=PADDING "$i" | wc -c)" != "0" ]; then
        metaflac --dont-use-padding --remove --block-type=PADDING "$i"
    fi
done
daniel-schmidt commented 8 years ago

I can confirm this bug on Kubuntu 15.10. I was actually not able to open the affected files through Dolphin (by drag&drop or context menu) or to add them to the media library. They are just ignored. The only way I found to add them to a playlist is via the "Files" button on the left. Then, I can play them, but no metadata is shown and the track length is 0.

The script from @nepella worked fine and fixed the files, thank you!

ghost commented 6 years ago

I probably has this issue as it cuts off and plays to play the files but it deletes the metadata.