Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#96 Can't seek to position in flac file

closed-fixed
Josh Coalson
libFLAC (57)
9
2004-10-01
2003-11-29
Kjetil Limkjćr
No

Noticed this while trying to play a flac file with
external cuesheet in Foobar2000 - one of the songs
would refuse to play because of a seek error. Case
suspected this to be a bug in libFLAC after some
testing, and doing the same operation on the command
line confirms this:

flac --skip 76689312 -d "Signos de Aberracion.flac"
test.wav
Signos de Aberracion.flac: ERROR seeking while skipping
bytes
state =
4:FLAC__FILE_DECODER_SEEK_ERROR

The file is encoded with default settings, FLAC 1.1.0.
If I encode the file with -8 instead of the default
settings the problem disappears.

If necessary I can make a copy of the file available
for download and testing, but be warned that it is
~400MB. Contact me on kjetil@yifan.net with any questions.

Discussion

  • Josh Coalson
    Josh Coalson
    2003-11-30

    • assigned_to: nobody --> jcoalson
    • status: open --> open-accepted
     
  • Josh Coalson
    Josh Coalson
    2003-11-30

    Logged In: YES
    user_id=78173

    First, what do you get if you do:

    flac -t "Signos de Aberracion.flac"

    Josh

     
  • Logged In: NO

    flac 1.1.0, Copyright (C) 2000,2001,2002,2003 Josh Coalson
    flac comes with ABSOLUTELY NO WARRANTY. This is free
    software, and you are
    welcome to redistribute it under certain conditions. Type
    `flac' for details.

    Signos de Aberacion.flac: ok

    I also already tried decompressing and recompressing with
    default settings, the resulting file is identical and the
    error is the same.

     
  • Logged In: YES
    user_id=920210

    oops, forgot to log in :)

     
  • Josh Coalson
    Josh Coalson
    2003-12-22

    Logged In: YES
    user_id=78173

    Hmm... I will need the file to debug it. Do you have
    somewhere to host it?

    Josh

     
  • mike newton
    mike newton
    2004-01-24

    Logged In: YES
    user_id=546604

    i'm having exactly the same problem on a couple of my flac
    files. i've tried recreating them to make sure something
    didn't happen during creation, no dice. "flac -t" on both
    files results in "ok".
    i can absolutely make the files available, let me know at
    mike(at)delusion(dot)org. the specifics for each file are:

    test1.flac (~275MB) --skip=28:00.10 --until=32:29.57
    test2.flac (~250MB) --skip=27:35.62 --until=33:12.42

    on both i get the: 4:FLAC__FILE_DECODER_SEEK_ERROR

     
  • mike newton
    mike newton
    2004-01-24

    Logged In: YES
    user_id=546604

    oops...found another one.

    test3.flac (~340MB) --skip=28:55.35 --until=31:31.02

     
  • Logged In: YES
    user_id=920210

    Grr, my spamfilter seems to have eaten your request for the
    file... I'll put it on my webserver and send you the URL by
    private email.

     
  • mike newton
    mike newton
    2004-01-25

    Logged In: YES
    user_id=546604

    interesting new info...i'm only having problems when i
    generate the flac file on my windoze box. if i generate it
    on a *nix box, such as my OSX box, it functions properly.
    i'm using EAC to generate the WAV file and then flac. if i
    generate the WAV file, xfer it to my mac and use flac there
    the flac file functions properly. if i use the mac to
    generate a PCM file and flac to generate the flac the file
    works flawlessly. seems to be isolated to my windoze
    binary. well, at least i have a workaround. :)

     
  • Josh Coalson
    Josh Coalson
    2004-03-22

    • priority: 5 --> 9
     
  • Josh Coalson
    Josh Coalson
    2004-03-22

    Logged In: YES
    user_id=78173

    I was able to reproduce the bug by decoding the file on
    linux. I see what's causing it now but it will take some
    thought to fix.

    the fact that it worked when the file was generated on
    another box was a fluke. the bug is related to the frame
    syncing mechanism which is sensitive to the stream
    contents.

    Josh

     
  • mike newton
    mike newton
    2004-03-22

    Logged In: YES
    user_id=546604

    interesting...a fluke. every file i've had difficulty with
    after encoding on my windoze box has functioned properly
    when encoding with my OSX box. anyway, just fyi.

     
  • Josh Coalson
    Josh Coalson
    2004-03-23

    Logged In: YES
    user_id=78173

    OK, I have checked in the fix to CVS. I'll close the bug
    at the next release.

    The problem was that the seek routine was jumping to a
    point in the stream whose audio data looked like a frame
    header from a future codec version (very rare). It
    thought the stream was unparseable and returned an error.
    Now it waits for many such frames in a row before deciding
    a stream is truly unparseable (only during a seek of
    course).

    Josh

     
  • mike newton
    mike newton
    2004-05-25

    Logged In: YES
    user_id=477815

    i don't suppose i could get a windows build with the fix in
    it? no biggie if not, i just use my windows machine cuz
    it's faster.

     
  • Josh Coalson
    Josh Coalson
    2004-07-19

    Logged In: YES
    user_id=78173

    Sorry, I work only on linux/bsd, I do the Windows
    porting just before release. There will be
    another release soon though.

    Josh

     
  • Josh Coalson
    Josh Coalson
    2004-07-19

    • status: open-accepted --> open-fixed
     
  • Josh Coalson
    Josh Coalson
    2004-10-01

    • status: open-fixed --> closed-fixed