Gilles Boccon-Gibod
2007-Mar-06 13:57 UTC
[Flac-dev] FLAC__stream_decoder_seek_absolute with FLAC__STREAM_DECODER_SEEK_ERROR in 1.1.3 but it worked before
I've upgraded to FLAC 1.1.3, and now I have some streams where seek does
not work anymore, but they used to work before.
After a bit of debugging, it looks like those streams (created a long
time ago with an old version of FLAC) have a seek table where all the
entries have a stream offset of 0.
The result is that in the function seek_to_absolute_sample_, on line
3076 (file stream_decoder.c), the following test returns:
/* make sure we are not seeking in corrupted stream */
if (this_frame_sample < lower_bound_sample) {
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
return false;
}
because 'this_frame_sample' is equal to 0 (because the seek table caused
the seek search to start at the beginning of the stream)
Now, since seeking in that file worked perfectly fine with older
libraries, I think it would be great if 1.1.3 and above would keep this
feature of still being able to seek even if the seek table is bogus like
this one (because people may have old streams like this one created by
an old verion of FLAC that did not create a correct seek table).
-- Gilles
Josh Coalson
2007-Mar-07 20:46 UTC
[Flac-dev] FLAC__stream_decoder_seek_absolute with FLAC__STREAM_DECODER_SEEK_ERROR in 1.1.3 but it worked before
can you host a FLAC file that has this problem? there have been some fixes to the seek routine since then and I would like to test with the latest. Josh --- Gilles Boccon-Gibod <bok@bok.net> wrote:> I've upgraded to FLAC 1.1.3, and now I have some streams where seek > does not work anymore, but they used to work before. > After a bit of debugging, it looks like those streams (created a long > time ago with an old version of FLAC) have a seek table where all the > > entries have a stream offset of 0. > The result is that in the function seek_to_absolute_sample_, on line > 3076 (file stream_decoder.c), the following test returns: > > /* make sure we are not seeking in corrupted stream */ > if (this_frame_sample < lower_bound_sample) { > decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; > return false; > } > > because 'this_frame_sample' is equal to 0 (because the seek table > caused the seek search to start at the beginning of the stream) > > Now, since seeking in that file worked perfectly fine with older > libraries, I think it would be great if 1.1.3 and above would keep > this > feature of still being able to seek even if the seek table is bogus > like > this one (because people may have old streams like this one created > by > an old verion of FLAC that did not create a correct seek table). > > > -- Gilles____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html