MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.17k stars 351 forks source link

flac: Failed to read OggFLAC tags #1643

Closed SoongNoonien closed 1 year ago

SoongNoonien commented 2 years ago

Bug report

Describe the bug

When the vorbis decoder plugin is disabled mpd fails to load the tags of ogg files correctly.

Expected Behavior

Even with the vorbis decoder disabled mpd should still be able to read ogg tags when there are alternative decoders available.

Actual Behavior

I disabled the vorbis decoder since it doesn't report the current bitrate. But with vorbis disabled mpd can't read the tags of ogg files properly anymore. While in most cases there is no observable problem, multiple artist tags in one file get concatenated with a semicolon in between.

Version

Music Player Daemon 0.23.9 (0.23.9)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2021 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple

Storage plugins:
 local smbclient udisks

Neighbor plugins:
 smbclient udisks

Decoders plugins:
 [mad] mp3 mp2
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [mpcdec] mpc
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
 [pcm]

Filters:
 soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo alsa pulse httpd

Encoder plugins:
 null vorbis opus wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip

Input plugins:
 file io_uring archive alsa curl ffmpeg smbclient

Playlist plugins:
 extm3u m3u pls flac cue embcue

Protocols:
 file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Configuration

auto_update     "yes"
restore_paused      "yes"

db_file         "~/.cache/mpd/database"
log_file        "~/.cache/mpd/log"

music_directory     "~/test"
pid_file        "~/.cache/mpd/pid"
state_file      "~/.cache/mpd/state"

log_level       "verbose"

metadata_to_use     "+comment"

audio_output {
    type        "pulse"
    name        "Musik"
    enabled     "yes"
}

audio_output {
    type        "httpd"
    name        "HTTP Stream"
    port        "8099"
    format      "44100:16:2"
    always_on   "yes"
}

decoder {
    plugin      "vorbis"
    enabled     "no"
}

Log

With vorbis disabled:

Oct 09 20:44 : client: [0] process command "rescan"
Oct 09 20:44 : update: spawned thread for update job id 1
Oct 09 20:44 : client: [0] command returned 0
Oct 09 20:44 : update: starting
Oct 09 20:44 : update: updating /01-04 - Think.ogg
Oct 09 20:44 : flac: Failed to read OggFLAC tags: FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR
Oct 09 20:44 : flac: Failed to read OggFLAC tags: FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR
Oct 09 20:44 : ffmpeg/ogg: Format ogg probed with size=2048 and score=100
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=-1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=0 psize=0 segp=0 nsegs=1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=-1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=30 psize=0 segp=0 nsegs=18
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=0
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=302 psize=0 segp=2 nsegs=18
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=-1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=4134 psize=0 segp=0 nsegs=48
Oct 09 20:44 : ffmpeg/ogg: found headers
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=-1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=0 psize=0 segp=0 nsegs=48
Oct 09 20:44 : ffmpeg/ogg: Before avformat_find_stream_info() pos: 8423 bytes read:89883 seeks:3 nb_streams:1
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: curidx=0
Oct 09 20:44 : ffmpeg/ogg: ogg_packet: idx=0 pstart=4134 psize=0 segp=0 nsegs=48
Oct 09 20:44 : ffmpeg/ogg: All info found
Oct 09 20:44 : ffmpeg/ogg: stream 0: start_time: 0 duration: 195.307
Oct 09 20:44 : ffmpeg/ogg: format: start_time: 0 duration: 195.307 (estimate from stream) bitrate=111 kb/s
Oct 09 20:44 : ffmpeg/ogg: After avformat_find_stream_info() pos: 8423 bytes read:89883 seeks:3 frames:1
Oct 09 20:44 : simple_db: removing empty directories from DB
Oct 09 20:44 : simple_db: sorting DB
Oct 09 20:44 : simple_db: writing DB
Oct 09 20:44 : update: finished

With vorbis enabled:

Oct 09 20:45 : client: [0] process command "rescan"
Oct 09 20:45 : update: spawned thread for update job id 1
Oct 09 20:45 : client: [0] command returned 0
Oct 09 20:45 : update: starting
Oct 09 20:45 : update: updating /01-04 - Think.ogg
Oct 09 20:45 : simple_db: removing empty directories from DB
Oct 09 20:45 : simple_db: sorting DB
Oct 09 20:45 : simple_db: writing DB
Oct 09 20:45 : update: finished
MaxKellermann commented 2 years ago

I can't reproduce your problem, but I don't think it has anything to do with MPD. This is a simple libFLAC function call failing with an internal error. Note that you forgot to post your MPD version number.

SoongNoonien commented 2 years ago

Note that you forgot to post your MPD version number.

I'm sorry, it was just a formatting error. In every code block the first line was missing. It's fixed now.

I can't reproduce your problem, but I don't think it has anything to do with MPD.

What did you try to reproduce? Maybe I can fix/change my tags accordingly.

MaxKellermann commented 1 year ago

What did you try to reproduce?

Your problem, of course. But since I can't, and nothing in your bug report suggests that this is a MPD-specific problem, I must assume it's a libFLAC problem.

SoongNoonien commented 1 year ago

Your problem, of course.

I meant what you did to reproduce the problem not which problem you were trying to reproduce. How did you add multiple tags with the same name? Which tag editor did you use? Because if you managed to create a .ogg file (with multiple tags with the same name) which is compatible with libFLAC and MPD I might be able to do the same thing if I knew how you did it.

But since I can't, and nothing in your bug report suggests that this is a MPD-specific problem, I must assume it's a libFLAC problem.

I could send you a file that reproduces the problem here.