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

add ..._get_resolved_state_string() convenience function

parent ee44de42
......@@ -743,6 +743,9 @@ FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__Str
*/
FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder);
/*@@@@ document */
FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(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
......
......@@ -508,6 +508,14 @@ FLAC_API FLAC__StreamDecoderState FLAC__file_encoder_get_verify_decoder_state(co
return FLAC__seekable_stream_encoder_get_verify_decoder_state(encoder->private_->seekable_stream_encoder);
}
FLAC_API const char *FLAC__file_encoder_get_resolved_state_string(const FLAC__FileEncoder *encoder)
{
if(encoder->protected_->state != FLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR)
return FLAC__FileEncoderStateString[encoder->protected_->state];
else
return FLAC__seekable_stream_encoder_get_resolved_state_string(encoder->private_->seekable_stream_encoder);
}
FLAC_API 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);
......
......@@ -508,6 +508,14 @@ FLAC_API FLAC__StreamDecoderState FLAC__seekable_stream_encoder_get_verify_decod
return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->stream_encoder);
}
FLAC_API const char *FLAC__seekable_stream_encoder_get_resolved_state_string(const FLAC__SeekableStreamEncoder *encoder)
{
if(encoder->protected_->state != FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR)
return FLAC__SeekableStreamEncoderStateString[encoder->protected_->state];
else
return FLAC__stream_encoder_get_resolved_state_string(encoder->private_->stream_encoder);
}
FLAC_API 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);
......
......@@ -1175,6 +1175,14 @@ FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(
return FLAC__STREAM_DECODER_UNINITIALIZED;
}
FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder)
{
if(encoder->protected_->state != FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR)
return FLAC__StreamEncoderStateString[encoder->protected_->state];
else
return FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(encoder->private_->verify.decoder)];
}
FLAC_API 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);
......
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