add OggFLAC__stream_encoder_get_resolved_state_string()
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 24 Sep 2003 04:34:56 +0000 (04:34 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 24 Sep 2003 04:34:56 +0000 (04:34 +0000)
src/libOggFLAC/stream_encoder.c

index 67544b4..afcc5a9 100644 (file)
@@ -79,7 +79,7 @@ typedef struct OggFLAC__StreamEncoderPrivate {
  *
  ***********************************************************************/
 
-const OggFLAC_API char * const OggFLAC__StreamEncoderStateString[] = {
+OggFLAC_API const char * const OggFLAC__StreamEncoderStateString[] = {
        "OggFLAC__STREAM_ENCODER_OK",
        "OggFLAC__STREAM_ENCODER_OGG_ERROR",
        "OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR",
@@ -492,6 +492,14 @@ OggFLAC_API FLAC__StreamDecoderState OggFLAC__stream_encoder_get_verify_decoder_
        return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->FLAC_stream_encoder);
 }
 
+OggFLAC_API const char *OggFLAC__stream_encoder_get_resolved_state_string(const OggFLAC__StreamEncoder *encoder)
+{
+       if(encoder->protected_->state != OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR)
+               return OggFLAC__StreamEncoderStateString[encoder->protected_->state];
+       else
+               return FLAC__stream_encoder_get_resolved_state_string(encoder->private_->FLAC_stream_encoder);
+}
+
 OggFLAC_API 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);