GNOME Bugzilla – Bug 791473
flacparse/dec: early eos if header indicates file is shorter than it actually is
Last modified: 2018-01-17 14:19:24 UTC
i have couple audio files which cause rhythmbox to stop playing and skip to next track on the album. i tested those with VLC and they play ok there. i could share offending track with a developer who would like to take a look on this. let me know.
you can probably test the track with gst-play. http://manpages.ubuntu.com/manpages/xenial/man1/gst-play-1.0.1.html and see the behavior.
thanks. so i did with one of the tracks that i remember to skip: $ gst-play-1.0 /home/wojtek/Music/Johann\ Johannsson/2012\ -\ Free\ the\ Mind/02\ Radio.flac Press 'k' to see a list of keyboard shortcuts. Now playing /home/wojtek/Music/Johann Johannsson/2012 - Free the Mind/02 Radio.flac Redistribute latency... 0:02:48.4 / 0:03:50.5 Reached end of play list. i am sure you see that it reached 2:48.4 and concluded it is end of the play list but the track has length of 3:50.5
What distribution are you using, and what versions of the various gstreamer packages do you have? Most importantly gst-plugins-good.
i am on Ubuntu 16.04.3. would this be helpful: $ dpkg --get-selections | grep -i gstreamer gir1.2-gstreamer-1.0 install gstreamer1.0-alsa:amd64 install gstreamer1.0-clutter-3.0 install gstreamer1.0-fluendo-mp3:amd64 install gstreamer1.0-libav:amd64 install gstreamer1.0-plugins-bad:amd64 install gstreamer1.0-plugins-bad-faad:amd64 install gstreamer1.0-plugins-bad-videoparsers:amd64 install gstreamer1.0-plugins-base:amd64 install gstreamer1.0-plugins-base-apps install gstreamer1.0-plugins-good:amd64 install gstreamer1.0-plugins-ugly:amd64 install gstreamer1.0-plugins-ugly-amr:amd64 install gstreamer1.0-pulseaudio:amd64 install gstreamer1.0-tools install gstreamer1.0-x:amd64 install libgstreamer-plugins-bad1.0-0:amd64 install libgstreamer-plugins-base1.0-0:amd64 install libgstreamer-plugins-good1.0-0:amd64 install libgstreamer1.0-0:amd64 install libreoffice-avmedia-backend-gstreamer install please let me know what information would be helpful to send you and how do i see it on the system. thanks and be well
Can you provide the exact version numbers of those packages? Output from 'gst-play-1.0 --gst-debug=*:4 --gst-debug-no-color file.flac' for at least one affected file would certainly help too, assuming this isn't already fixed in newer versions.
i did: $ gst-play-1.0 --gst-debug=*:4 --gst-debug-no-color /home/wojtek/Music/Johann\ Johannsson/2012\ -\ Free\ the\ Mind/02\ Radio.flac &> output.txt and uploaded outout.txt to https://share.riseup.net/#ZrR8pQFUQSMBj3SLsUhJTg i also uploaded "02 Radio.flac" to https://share.riseup.net/#cPfox7HC_GzMoL1ZB_ftaw i hope this helps
Created attachment 365705 [details] Audacity sample view of the above flac file The content length of the flac audio is only 2 min 48.484 seconds ( which is in line with #c2 ).
well.. VLC plays whole 3:50... and 2:48 is not the end of the audio file.
that is correct. converting the flac to wav file ( ffmpeg -i "02 Radio.flac" "02 Radio.wav" ) and loading in audacity gives length of 3:50.
Relevant lines from 'gst-play-1.0 --gst-debug=*:4 --gst-debug-no-color 02\ Radio.flac': 0:02:47.498260346 6190 0x7fc1c4183280 INFO flacdec gstflacdec.c:739:gst_flac_dec_flush:<flacdec0> draining, 5924360 bytes left in adapter 0:02:47.498305066 6190 0x7fc1c4183280 WARN audiodecoder gstaudiodecoder.c:1596:gst_audio_decoder_drain:<flacdec0> still 669 frames left after draining 0:02:47.499097615 6190 0x7fc1c4183280 INFO task gsttask.c:319:gst_task_func:<flacparse0:sink> Task going to paused vlc and mplayer, both play fine till 3m 50s.
$ gst-play-1.0 --version gst-play-1.0 version 1.12.4 GStreamer 1.12.4 http://packages.qa.debian.org/gst-plugins-base1.
libflac seems to be unhappy with the flac file, as below: $ flac --analyze 02\ Radio.flac flac 1.3.2 02 Radio.flac: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC 02 Radio.flac: ERROR while decoding data state = FLAC__STREAM_DECODER_ABORTED So, this could be a case of "make flac file play through errors" bug for gstreamer.
mplayer, gst-playbin, vlc all use libFLAC. 1. mplayer handles packets past EOF, so it continues to play as long as possible. [flac @ 0x7fd71466c920]Got unexpected packet after EOF A: 168.3 (02:48.3) of 230.0 (03:50.0) 0.7% [flac @ 0x7fd71466c920]Got unexpected packet after EOF A: 168.5 (02:48.5) of 230.0 (03:50.0) 0.7% 2. vlc seems to handle it too. There is a minor 0.5 second glitch at 2m:48s, with the following log [0000556c7735eb80] main audio output warning: playback way too early (-186201): playing silence [0000556c7735eb80] main audio output debug: inserting 8211 zeroes past which it continues to play So, gstreamer "flacdec" plugin can probably handle this special case, and let the file play as long as possible.
A sample file would be helpful indeed.
Tim-Philipp here you are same file again: https://share.riseup.net/#CQ0rKTXJRsNDP7iyhAZMPw
Sorry, I missed that earlier, I thought it was both links to a log file.
Created attachment 366493 [details] [review] flacdec: flush flac decoder on lost sync. This to allow the decoder to start searching for a new frame again.
With the attached patch, file plays back for the whole duration, with a minor glitch around 02:48 as well.
Comment on attachment 366493 [details] [review] flacdec: flush flac decoder on lost sync. We can't do the decoder flush directly in the callback?
No, https://xiph.org/flac/api/group__flac__stream__decoder.html#ga4fab6730ff0b22bf45ca4cd04d706569 :)
Attachment 366493 [details] pushed as 34abfbf - flacdec: flush flac decoder on lost sync.