Commit 589f8c78 authored by Josh Coalson's avatar Josh Coalson
Browse files

add ..._get_verify_decoder_error_stats()

parent 021cb51e
......@@ -119,6 +119,7 @@ namespace FLAC {
State get_state() const;
Decoder::Stream::State get_verify_decoder_state() const;
void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
bool get_verify() const;
bool get_streamable_subset() const;
bool get_do_mid_side_stereo() const;
......@@ -213,6 +214,7 @@ namespace FLAC {
State get_state() const;
Stream::State get_stream_encoder_state() const;
Decoder::Stream::State get_verify_decoder_state() const;
void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
bool get_verify() const;
bool get_streamable_subset() const;
bool get_do_mid_side_stereo() const;
......@@ -309,6 +311,7 @@ namespace FLAC {
SeekableStream::State get_seekable_stream_encoder_state() const;
Stream::State get_stream_encoder_state() const;
Decoder::Stream::State get_verify_decoder_state() const;
void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
bool get_verify() const;
bool get_streamable_subset() const;
bool get_do_mid_side_stereo() const;
......@@ -337,11 +340,11 @@ namespace FLAC {
bool process(const FLAC__int32 * const buffer[], unsigned samples);
bool process_interleaved(const FLAC__int32 buffer[], unsigned samples);
protected:
virtual void progress_callback(unsigned current_frame, unsigned total_frames_estimate);
virtual void progress_callback(FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate);
::FLAC__FileEncoder *encoder_;
private:
static void progress_callback_(const ::FLAC__FileEncoder *encoder, unsigned current_frame, unsigned total_frames_estimate, void *client_data);
static void progress_callback_(const ::FLAC__FileEncoder *encoder, FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data);
// Private and undefined so you can't use them:
File(const Stream &);
......
......@@ -151,7 +151,7 @@ typedef struct {
} FLAC__FileEncoder;
/*@@@ document: */
typedef void (*FLAC__FileEncoderProgressCallback)(const FLAC__FileEncoder *encoder, unsigned current_frame, unsigned total_frames_estimate, void *client_data);
typedef void (*FLAC__FileEncoderProgressCallback)(const FLAC__FileEncoder *encoder, FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data);
/***********************************************************************
......@@ -531,6 +531,28 @@ FLAC__StreamEncoderState FLAC__file_encoder_get_stream_encoder_state(const FLAC_
*/
FLAC__StreamDecoderState FLAC__file_encoder_get_verify_decoder_state(const FLAC__FileEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Inherited from FLAC__seekable_stream_encoder_get_verify_decoder_error_stats().
* Useful when the file encoder state is
* \c FLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR and the seekable stream
* encoder state is
* \c FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR and the
* stream encoder state is
* \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
*
* \param encoder An encoder instance to query.
* \param absolute_sample The absolute sample number of the mismatch.
* \param frame_number The number of the frame in which the mismatch occurred.
* \param channel The channel in which the mismatch occurred.
* \param sample The number of the sample (relative to the frame) in
* which the mismatch occurred.
* \param expected The expected value for the sample in question.
* \param got The actual value returned by the decoder.
* \assert
* \code encoder != NULL \endcode
*/
void FLAC__file_encoder_get_verify_decoder_error_stats(const FLAC__FileEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
/** Get the "verify" flag.
* This is inherited from FLAC__SeekableStreamEncoder; see
* FLAC__seekable_stream_encoder_get_verify().
......
......@@ -530,6 +530,26 @@ FLAC__StreamEncoderState FLAC__seekable_stream_encoder_get_stream_encoder_state(
*/
FLAC__StreamDecoderState FLAC__seekable_stream_encoder_get_verify_decoder_state(const FLAC__SeekableStreamEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Inherited from FLAC__stream_encoder_get_verify_decoder_error_stats().
* Useful when the seekable stream encoder state is
* \c FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR and the
* stream encoder state is
* \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
*
* \param encoder An encoder instance to query.
* \param absolute_sample The absolute sample number of the mismatch.
* \param frame_number The number of the frame in which the mismatch occurred.
* \param channel The channel in which the mismatch occurred.
* \param sample The number of the sample (relative to the frame) in
* which the mismatch occurred.
* \param expected The expected value for the sample in question.
* \param got The actual value returned by the decoder.
* \assert
* \code encoder != NULL \endcode
*/
void FLAC__seekable_stream_encoder_get_verify_decoder_error_stats(const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
/** Get the "verify" flag.
* This is inherited from FLAC__StreamEncoder; see
* FLAC__stream_encoder_get_verify().
......
......@@ -691,6 +691,25 @@ FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncode
*/
FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Useful when the stream encoder state is
* \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. The arguments should
* be addresses in which the stats will be returned, or NULL if value
* is not desired.
*
* \param encoder An encoder instance to query.
* \param absolute_sample The absolute sample number of the mismatch.
* \param frame_number The number of the frame in which the mismatch occurred.
* \param channel The channel in which the mismatch occurred.
* \param sample The number of the sample (relative to the frame) in
* which the mismatch occurred.
* \param expected The expected value for the sample in question.
* \param got The actual value returned by the decoder.
* \assert
* \code encoder != NULL \endcode
*/
void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
/** Get the "verify" flag.
*
* \param encoder An encoder instance to query.
......
......@@ -121,6 +121,7 @@ namespace OggFLAC {
State get_state() const;
FLAC::Encoder::Stream::State get_FLAC_stream_encoder_state() const;
FLAC::Decoder::Stream::State get_verify_decoder_state() const;
void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
bool get_verify() const;
bool get_streamable_subset() const;
bool get_do_mid_side_stereo() const;
......
......@@ -438,6 +438,31 @@ FLAC__StreamEncoderState OggFLAC__stream_encoder_get_FLAC_stream_encoder_state(c
*/
FLAC__StreamDecoderState OggFLAC__stream_encoder_get_verify_decoder_state(const OggFLAC__StreamEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Inherited from FLAC__stream_encoder_get_verify_decoder_error_stats().
* Useful when the stream encoder state is
* \c OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR and the
* FLAC stream encoder state is
* \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
*
* \param encoder An encoder instance to query.
* \param absolute_sample The absolute sample number of the mismatch.
* \param frame_number The number of the frame in which the mismatch occurred.
* \param channel The channel in which the mismatch occurred.
* \param sample The number of the sample (relative to the frame) in
* which the mismatch occurred.
* \param expected The expected value for the sample in question.
* \param got The actual value returned by the decoder.
* \assert
* \code encoder != NULL \endcode
* \code absolute_sample != NULL \encode
* \code frame_number != NULL \encode
* \code channel != NULL \encode
* \code sample != NULL \encode
* \code expected != NULL \encode
*/
void OggFLAC__stream_encoder_get_verify_decoder_error_stats(const OggFLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
/* This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_verify()
*
* \param encoder An encoder instance to query.
......
......@@ -178,6 +178,12 @@ namespace FLAC {
return Decoder::Stream::State(::FLAC__file_encoder_get_verify_decoder_state(encoder_));
}
void File::get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(is_valid());
return ::FLAC__file_encoder_get_verify_decoder_error_stats(encoder_, absolute_sample, frame_number, channel, sample, expected, got);
}
bool File::get_verify() const
{
FLAC__ASSERT(is_valid());
......@@ -306,18 +312,18 @@ namespace FLAC {
return (bool)::FLAC__file_encoder_process_interleaved(encoder_, buffer, samples);
}
void File::progress_callback(unsigned current_frame, unsigned total_frames_estimate)
void File::progress_callback(FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate)
{
(void)current_frame, (void)total_frames_estimate;
(void)bytes_written, (void)frames_written, (void)total_frames_estimate;
}
void File::progress_callback_(const ::FLAC__FileEncoder *encoder, unsigned current_frame, unsigned total_frames_estimate, void *client_data)
void File::progress_callback_(const ::FLAC__FileEncoder *encoder, FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data)
{
(void)encoder;
FLAC__ASSERT(0 != client_data);
File *instance = reinterpret_cast<File *>(client_data);
FLAC__ASSERT(0 != instance);
instance->progress_callback(current_frame, total_frames_estimate);
instance->progress_callback(bytes_written, frames_written, total_frames_estimate);
}
};
......
......@@ -166,6 +166,12 @@ namespace FLAC {
return Decoder::Stream::State(::FLAC__seekable_stream_encoder_get_verify_decoder_state(encoder_));
}
void SeekableStream::get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(is_valid());
return ::FLAC__seekable_stream_encoder_get_verify_decoder_error_stats(encoder_, absolute_sample, frame_number, channel, sample, expected, got);
}
bool SeekableStream::get_verify() const
{
FLAC__ASSERT(is_valid());
......
......@@ -160,6 +160,12 @@ namespace FLAC {
return Decoder::Stream::State(::FLAC__stream_encoder_get_verify_decoder_state(encoder_));
}
void Stream::get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(is_valid());
return ::FLAC__stream_encoder_get_verify_decoder_error_stats(encoder_, absolute_sample, frame_number, channel, sample, expected, got);
}
bool Stream::get_verify() const
{
FLAC__ASSERT(is_valid());
......
......@@ -44,6 +44,7 @@ typedef struct FLAC__FileEncoderPrivate {
FLAC__FileEncoderProgressCallback progress_callback;
void *client_data;
char *filename;
FLAC__uint64 bytes_written;
unsigned total_frames_estimate;
FLAC__SeekableStreamEncoder *seekable_stream_encoder;
FILE *file;
......@@ -154,6 +155,8 @@ FLAC__FileEncoderState FLAC__file_encoder_init(FLAC__FileEncoder *encoder)
if(encoder->private_->file == 0)
return encoder->protected_->state = FLAC__FILE_ENCODER_ERROR_OPENING_FILE;
encoder->private_->bytes_written = 0;
FLAC__seekable_stream_encoder_set_seek_callback(encoder->private_->seekable_stream_encoder, seek_callback_);
FLAC__seekable_stream_encoder_set_write_callback(encoder->private_->seekable_stream_encoder, write_callback_);
FLAC__seekable_stream_encoder_set_client_data(encoder->private_->seekable_stream_encoder, encoder);
......@@ -467,6 +470,13 @@ FLAC__StreamDecoderState FLAC__file_encoder_get_verify_decoder_state(const FLAC_
return FLAC__seekable_stream_encoder_get_verify_decoder_state(encoder->private_->seekable_stream_encoder);
}
void FLAC__file_encoder_get_verify_decoder_error_stats(const FLAC__FileEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(0 != encoder);
FLAC__ASSERT(0 != encoder->private_);
return FLAC__seekable_stream_encoder_get_verify_decoder_error_stats(encoder->private_->seekable_stream_encoder, absolute_sample, frame_number, channel, sample, expected, got);
}
FLAC__bool FLAC__file_encoder_get_verify(const FLAC__FileEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
......@@ -652,8 +662,9 @@ FLAC__StreamEncoderWriteStatus write_callback_(const FLAC__SeekableStreamEncoder
FLAC__ASSERT(0 != file_encoder);
if(fwrite(buffer, sizeof(FLAC__byte), bytes, file_encoder->private_->file) == bytes) {
if(0 != file_encoder->private_->progress_callback)
file_encoder->private_->progress_callback(file_encoder, current_frame, file_encoder->private_->total_frames_estimate, file_encoder->private_->client_data);
file_encoder->private_->bytes_written += bytes;
if(0 != file_encoder->private_->progress_callback && samples > 0)
file_encoder->private_->progress_callback(file_encoder, file_encoder->private_->bytes_written, current_frame+1, file_encoder->private_->total_frames_estimate, file_encoder->private_->client_data);
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
}
else
......
......@@ -470,6 +470,13 @@ FLAC__StreamDecoderState FLAC__seekable_stream_encoder_get_verify_decoder_state(
return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->stream_encoder);
}
void FLAC__seekable_stream_encoder_get_verify_decoder_error_stats(const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(0 != encoder);
FLAC__ASSERT(0 != encoder->private_);
return FLAC__stream_encoder_get_verify_decoder_error_stats(encoder->private_->stream_encoder, absolute_sample, frame_number, channel, sample, expected, got);
}
FLAC__bool FLAC__seekable_stream_encoder_get_verify(const FLAC__SeekableStreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
......
......@@ -61,8 +61,6 @@ typedef enum {
ENCODER_IN_AUDIO = 2
} EncoderStateHint;
/*@@@@ function for getting the error_stats */
/***********************************************************************
*
* Private class method prototypes
......@@ -511,6 +509,12 @@ FLAC__StreamEncoderState FLAC__stream_encoder_init(FLAC__StreamEncoder *encoder)
if(FLAC__stream_decoder_init(encoder->private_->verify.decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
return encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR;
}
encoder->private_->verify.error_stats.absolute_sample = 0;
encoder->private_->verify.error_stats.frame_number = 0;
encoder->private_->verify.error_stats.channel = 0;
encoder->private_->verify.error_stats.sample = 0;
encoder->private_->verify.error_stats.expected = 0;
encoder->private_->verify.error_stats.got = 0;
/*
* write the stream header
......@@ -830,6 +834,23 @@ FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLA
return FLAC__STREAM_DECODER_UNINITIALIZED;
}
void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(0 != encoder);
if(0 != absolute_sample)
*absolute_sample = encoder->private_->verify.error_stats.absolute_sample;
if(0 != frame_number)
*frame_number = encoder->private_->verify.error_stats.frame_number;
if(0 != channel)
*channel = encoder->private_->verify.error_stats.channel;
if(0 != sample)
*sample = encoder->private_->verify.error_stats.sample;
if(0 != expected)
*expected = encoder->private_->verify.error_stats.expected;
if(0 != got)
*got = encoder->private_->verify.error_stats.got;
}
FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
......
......@@ -166,6 +166,12 @@ namespace OggFLAC {
return FLAC::Decoder::Stream::State(::OggFLAC__stream_encoder_get_verify_decoder_state(encoder_));
}
void Stream::get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(is_valid());
return ::OggFLAC__stream_encoder_get_verify_decoder_error_stats(encoder_, absolute_sample, frame_number, channel, sample, expected, got);
}
bool Stream::get_verify() const
{
FLAC__ASSERT(is_valid());
......
......@@ -432,6 +432,13 @@ FLAC__StreamDecoderState OggFLAC__stream_encoder_get_verify_decoder_state(const
return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->FLAC_stream_encoder);
}
void OggFLAC__stream_encoder_get_verify_decoder_error_stats(const OggFLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
{
FLAC__ASSERT(0 != encoder);
FLAC__ASSERT(0 != encoder->private_);
return FLAC__stream_encoder_get_verify_decoder_error_stats(encoder->private_->FLAC_stream_encoder, absolute_sample, frame_number, channel, sample, expected, got);
}
FLAC__bool OggFLAC__stream_encoder_get_verify(const OggFLAC__StreamEncoder *encoder)
{
FLAC__ASSERT(0 != encoder);
......
......@@ -279,6 +279,19 @@ static bool test_stream_encoder()
FLAC::Encoder::Stream::State state = encoder->get_state();
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring());
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing get_verify_decoder_error_stats()... ");
encoder->get_verify_decoder_error_stats(&absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing get_verify()... ");
if(encoder->get_verify() != true) {
printf("FAILED, expected true, got false\n");
......@@ -602,6 +615,19 @@ static bool test_seekable_stream_encoder()
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing get_verify_decoder_error_stats()... ");
encoder->get_verify_decoder_error_stats(&absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing get_verify()... ");
if(encoder->get_verify() != true) {
printf("FAILED, expected true, got false\n");
......@@ -752,14 +778,13 @@ public:
~FileEncoder() { }
// from FLAC::Encoder::File
void progress_callback(unsigned current_frame, unsigned total_frames_estimate);
void progress_callback(FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate);
bool die(const char *msg = 0) const;
};
void FileEncoder::progress_callback(unsigned current_frame, unsigned total_frames_estimate)
void FileEncoder::progress_callback(FLAC__uint64, unsigned, unsigned)
{
(void)current_frame, (void)total_frames_estimate;
}
bool FileEncoder::die(const char *msg) const
......@@ -928,6 +953,19 @@ static bool test_file_encoder()
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing get_verify_decoder_error_stats()... ");
encoder->get_verify_decoder_error_stats(&absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing get_verify()... ");
if(encoder->get_verify() != true) {
printf("FAILED, expected true, got false\n");
......
......@@ -328,6 +328,19 @@ static FLAC__bool test_stream_encoder()
dstate = FLAC__stream_encoder_get_verify_decoder_state(encoder);
printf("returned state = %u (%s)... OK\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing FLAC__stream_encoder_get_verify_decoder_error_stats()... ");
FLAC__stream_encoder_get_verify_decoder_error_stats(encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing FLAC__stream_encoder_get_verify()... ");
if(FLAC__stream_encoder_get_verify(encoder) != true) {
printf("FAILED, expected true, got false\n");
......@@ -626,6 +639,19 @@ static FLAC__bool test_seekable_stream_encoder()
dstate = FLAC__seekable_stream_encoder_get_verify_decoder_state(encoder);
printf("returned state = %u (%s)... OK\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing FLAC__seekable_stream_encoder_get_verify_decoder_error_stats()... ");
FLAC__seekable_stream_encoder_get_verify_decoder_error_stats(encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing FLAC__seekable_stream_encoder_get_verify()... ");
if(FLAC__seekable_stream_encoder_get_verify(encoder) != true) {
printf("FAILED, expected true, got false\n");
......@@ -770,9 +796,9 @@ static FLAC__bool test_seekable_stream_encoder()
return true;
}
static void file_encoder_progress_callback_(const FLAC__FileEncoder *encoder, unsigned current_frame, unsigned total_frames_estimate, void *client_data)
static void file_encoder_progress_callback_(const FLAC__FileEncoder *encoder, FLAC__uint64 bytes_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data)
{
(void)encoder, (void)current_frame, (void)total_frames_estimate, (void)client_data;
(void)encoder, (void)bytes_written, (void)frames_written, (void)total_frames_estimate, (void)client_data;
}
static FLAC__bool test_file_encoder()
......@@ -922,6 +948,19 @@ static FLAC__bool test_file_encoder()
dstate = FLAC__file_encoder_get_verify_decoder_state(encoder);
printf("returned state = %u (%s)... OK\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
{
FLAC__uint64 absolute_sample;
unsigned frame_number;
unsigned channel;
unsigned sample;
FLAC__int32 expected;
FLAC__int32 got;
printf("testing FLAC__file_encoder_get_verify_decoder_error_stats()... ");
FLAC__file_encoder_get_verify_decoder_error_stats(encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got);
printf("OK\n");
}
printf("testing FLAC__file_encoder_get_verify()... ");
if(FLAC__file_encoder_get_verify(encoder) != true) {
printf("FAILED, expected true, got false\n");
......
Markdown is supported
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