Commit ab5c1d15 authored by Josh Coalson's avatar Josh Coalson
Browse files

fix bug where calling FLAC__seekable_stream_decoder_set_metadata_ignore_*() to...

fix bug where calling FLAC__seekable_stream_decoder_set_metadata_ignore_*() to ignore STREAMINFO or SEEKTABLE would also prevent the seekable stream decoder from getting the blocks later, which it needs to be able to seek
parent b7fcd591
...@@ -420,11 +420,16 @@ FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__Seek ...@@ -420,11 +420,16 @@ FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore(FLAC__Seek
FLAC__ASSERT(0 != decoder->private_->stream_decoder); FLAC__ASSERT(0 != decoder->private_->stream_decoder);
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED) if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED)
return false; return false;
if(type == FLAC__METADATA_TYPE_STREAMINFO) if(type == FLAC__METADATA_TYPE_STREAMINFO) {
decoder->private_->ignore_stream_info_block = true; decoder->private_->ignore_stream_info_block = true;
else if(type == FLAC__METADATA_TYPE_SEEKTABLE) return true;
}
else if(type == FLAC__METADATA_TYPE_SEEKTABLE) {
decoder->private_->ignore_seek_table_block = true; decoder->private_->ignore_seek_table_block = true;
return FLAC__stream_decoder_set_metadata_ignore(decoder->private_->stream_decoder, type); return true;
}
else
return FLAC__stream_decoder_set_metadata_ignore(decoder->private_->stream_decoder, type);
} }
FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4]) FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_application(FLAC__SeekableStreamDecoder *decoder, const FLAC__byte id[4])
...@@ -448,7 +453,10 @@ FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__ ...@@ -448,7 +453,10 @@ FLAC_API FLAC__bool FLAC__seekable_stream_decoder_set_metadata_ignore_all(FLAC__
return false; return false;
decoder->private_->ignore_stream_info_block = true; decoder->private_->ignore_stream_info_block = true;
decoder->private_->ignore_seek_table_block = true; decoder->private_->ignore_seek_table_block = true;
return FLAC__stream_decoder_set_metadata_ignore_all(decoder->private_->stream_decoder); return
FLAC__stream_decoder_set_metadata_ignore_all(decoder->private_->stream_decoder) &&
FLAC__stream_decoder_set_metadata_respond(decoder->private_->stream_decoder, FLAC__METADATA_TYPE_STREAMINFO) &&
FLAC__stream_decoder_set_metadata_respond(decoder->private_->stream_decoder, FLAC__METADATA_TYPE_SEEKTABLE);
} }
FLAC_API FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_state(const FLAC__SeekableStreamDecoder *decoder) FLAC_API FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_state(const FLAC__SeekableStreamDecoder *decoder)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment