add a "tell" callback to the seekable stream encoder to make the metadata writeback more robust

This commit is contained in:
Josh Coalson
2003-09-25 04:01:49 +00:00
parent 792ddbf4c5
commit 6e2c6d9958
8 changed files with 237 additions and 54 deletions

View File

@@ -422,6 +422,12 @@ FLAC__SeekableStreamEncoderSeekStatus seekable_stream_encoder_seek_callback_(con
return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
}
FLAC__SeekableStreamEncoderTellStatus seekable_stream_encoder_tell_callback_(const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
{
(void)encoder, (void)absolute_byte_offset, (void)client_data;
return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK;
}
FLAC__StreamEncoderWriteStatus seekable_stream_encoder_write_callback_(const FLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data)
{
(void)encoder, (void)buffer, (void)bytes, (void)samples, (void)current_frame, (void)client_data;
@@ -545,6 +551,11 @@ static FLAC__bool test_seekable_stream_encoder()
return die_ss_("returned false", encoder);
printf("OK\n");
printf("testing FLAC__seekable_stream_encoder_set_tell_callback()... ");
if(!FLAC__seekable_stream_encoder_set_tell_callback(encoder, seekable_stream_encoder_tell_callback_))
return die_ss_("returned false", encoder);
printf("OK\n");
printf("testing FLAC__seekable_stream_encoder_set_write_callback()... ");
if(!FLAC__seekable_stream_encoder_set_write_callback(encoder, seekable_stream_encoder_write_callback_))
return die_ss_("returned false", encoder);