more work
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 6 Aug 2002 06:09:06 +0000 (06:09 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 6 Aug 2002 06:09:06 +0000 (06:09 +0000)
include/OggFLAC/stream_decoder.h
include/OggFLAC/stream_encoder.h
src/libOggFLAC/stream_decoder.c
src/libOggFLAC/stream_encoder.c

index 08f2450..01ccabc 100644 (file)
@@ -72,6 +72,9 @@ typedef enum {
        OggFLAC__STREAM_DECODER_OK = 0,
        /**< The decoder is in the normal OK state. */
 
+       OggFLAC__STREAM_ENCODER_OGG_ERROR,
+       /**< An error occurred in the underlying Ogg layer.  */
+
        OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR,
        /**< An error occurred in the underlying FLAC stream decoder;
         * check OggFLAC__stream_decoder_get_FLAC_stream_decoder_state().
index 5e4c45b..77b8e28 100644 (file)
@@ -72,6 +72,9 @@ typedef enum {
        OggFLAC__STREAM_ENCODER_OK = 0,
        /**< The encoder is in the normal OK state. */
 
+       OggFLAC__STREAM_ENCODER_OGG_ERROR,
+       /**< An error occurred in the underlying Ogg layer.  */
+
        OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR,
        /**< An error occurred in the underlying FLAC stream encoder;
         * check OggFLAC__stream_encoder_get_FLAC_stream_encoder_state().
index 19f0355..67f26e1 100644 (file)
  *
  ***********************************************************************/
 
-static void set_defaults_(FLAC__StreamDecoder *decoder);
+static void set_defaults_(OggFLAC__StreamDecoder *decoder);
+static FLAC__StreamDecoderReadStatus read_callback_(const OggFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
+static FLAC__StreamDecoderWriteStatus write_callback_(const OggFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+static void metadata_callback_(const OggFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+static void error_callback_(const OggFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
 
 
 /***********************************************************************
@@ -36,13 +40,18 @@ static void set_defaults_(FLAC__StreamDecoder *decoder);
  *
  ***********************************************************************/
 
-typedef struct FLAC__StreamDecoderPrivate {
-       FLAC__StreamDecoderReadCallback read_callback;
-       FLAC__StreamDecoderWriteCallback write_callback;
-       FLAC__StreamDecoderMetadataCallback metadata_callback;
-       FLAC__StreamDecoderErrorCallback error_callback;
+typedef struct OggFLAC__StreamDecoderPrivate {
+       OggFLAC__StreamDecoderReadCallback read_callback;
+       OggFLAC__StreamDecoderWriteCallback write_callback;
+       OggFLAC__StreamDecoderMetadataCallback metadata_callback;
+       OggFLAC__StreamDecoderErrorCallback error_callback;
        void *client_data;
-} FLAC__StreamDecoderPrivate;
+       FLAC__StreamDecoder *FLAC_stream_decoder;
+       struct {
+               ogg_stream_state stream_state;
+               ogg_sync_state sync_state;
+       } ogg;
+} OggFLAC__StreamDecoderPrivate;
 
 /***********************************************************************
  *
@@ -50,8 +59,9 @@ typedef struct FLAC__StreamDecoderPrivate {
  *
  ***********************************************************************/
 
-const char * const FLAC__StreamDecoderStateString[] = {
+const char * const OggFLAC__StreamDecoderStateString[] = {
        "OggFLAC__STREAM_DECODER_OK",
+       "OggFLAC__STREAM_DECODER_OGG_ERROR",
        "OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR",
        "OggFLAC__STREAM_DECODER_INVALID_CALLBACK",
        "OggFLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR",
@@ -595,3 +605,19 @@ void set_defaults_(FLAC__StreamDecoder *decoder)
        decoder->private_->metadata_filter[FLAC__METADATA_TYPE_STREAMINFO] = true;
        decoder->private_->metadata_filter_ids_count = 0;
 }
+
+FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
+{
+}
+
+FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+{
+}
+
+void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+{
+}
+
+void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+{
+}
index 20beee5..85c60b2 100644 (file)
@@ -45,7 +45,7 @@ static void metadata_callback_(const FLAC__StreamEncoder *encoder, const FLAC__S
 typedef struct FLAC__StreamEncoderPrivate {
        OggFLAC__StreamEncoderWriteCallback write_callback;
        void *client_data;
-       FLAC__StreamEncoder *stream_encoder;
+       FLAC__StreamEncoder *FLAC_stream_encoder;
        /* internal vars (all the above are class settings) */
        FLAC__bool is_first_packet;
        FLAC__uint64 samples_written;
@@ -64,6 +64,7 @@ typedef struct FLAC__StreamEncoderPrivate {
 
 const char * const OggFLAC__StreamEncoderStateString[] = {
        "OggFLAC__STREAM_ENCODER_OK",
+       "OggFLAC__STREAM_ENCODER_OGG_ERROR",
        "OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR",
        "OggFLAC__STREAM_ENCODER_INVALID_CALLBACK",
        "OggFLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR",
@@ -102,8 +103,8 @@ OggFLAC__StreamEncoder *OggFLAC__stream_encoder_new()
        }
        memset(encoder->private_, 0, sizeof(OggFLAC__StreamEncoderPrivate));
 
-       encoder->private_->stream_encoder = FLAC__stream_encoder_new();
-       if(0 == encoder->private_->stream_encoder) {
+       encoder->private_->FLAC_stream_encoder = FLAC__stream_encoder_new();
+       if(0 == encoder->private_->FLAC_stream_encoder) {
                free(encoder->private_);
                free(encoder->protected_);
                free(encoder);
@@ -122,11 +123,11 @@ void OggFLAC__stream_encoder_delete(OggFLAC__StreamEncoder *encoder)
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->protected_);
        FLAC__ASSERT(0 != encoder->private_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
 
        (void)OggFLAC__stream_encoder_finish(encoder);
  
-       FLAC__stream_encoder_delete(encoder->private_->stream_encoder);
+       FLAC__stream_encoder_delete(encoder->private_->FLAC_stream_encoder);
 
        free(encoder->private_);
        free(encoder->protected_);
@@ -150,11 +151,14 @@ OggFLAC__StreamEncoderState OggFLAC__stream_encoder_init(FLAC__StreamEncoder *en
        if(0 == encoder->private_->write_callback)
                return encoder->protected_->state = OggFLAC__STREAM_ENCODER_INVALID_CALLBACK;
 
-       FLAC__stream_encoder_set_write_callback(encoder->private_->stream_encoder, write_callback_);
-       FLAC__stream_encoder_set_metadata_callback(encoder->private_->stream_encoder, metadata_callback_);
-       FLAC__stream_encoder_set_client_data(encoder->private_->stream_encoder, encoder);
+       if(ogg_stream_init(&encoder->private_->ogg.stream_state, 0) != 0)
+               return encoder->protected_->state = OggFLAC__STREAM_ENCODER_OGG_ERROR;
 
-       if(FLAC__stream_encoder_init(encoder->private_->stream_encoder) != FLAC__STREAM_ENCODER_OK)
+       FLAC__stream_encoder_set_write_callback(encoder->private_->FLAC_stream_encoder, write_callback_);
+       FLAC__stream_encoder_set_metadata_callback(encoder->private_->FLAC_stream_encoder, metadata_callback_);
+       FLAC__stream_encoder_set_client_data(encoder->private_->FLAC_stream_encoder, encoder);
+
+       if(FLAC__stream_encoder_init(encoder->private_->FLAC_stream_encoder) != FLAC__STREAM_ENCODER_OK)
                return encoder->protected_->state = OggFLAC__STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR;
 
        encoder->private_->is_first_packet = true;
@@ -172,9 +176,11 @@ void OggFLAC__stream_encoder_finish(OggFLAC__StreamEncoder *encoder)
        if(encoder->protected_->state == OggFLAC__STREAM_ENCODER_UNINITIALIZED)
                return;
 
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
+
+       FLAC__stream_encoder_finish(encoder->private_->FLAC_stream_encoder);
 
-       FLAC__stream_encoder_finish(encoder->private_->stream_encoder);
+       ogg_stream_clear(&encoder->private_->ogg.stream_state);
 
        set_defaults_(encoder);
 
@@ -186,10 +192,10 @@ FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__b
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_verify(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_verify(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_streamable_subset(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -197,10 +203,10 @@ FLAC__bool OggFLAC__stream_encoder_set_streamable_subset(OggFLAC__StreamEncoder
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_streamable_subset(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_streamable_subset(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_do_mid_side_stereo(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -208,10 +214,10 @@ FLAC__bool OggFLAC__stream_encoder_set_do_mid_side_stereo(OggFLAC__StreamEncoder
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_do_mid_side_stereo(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_do_mid_side_stereo(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_loose_mid_side_stereo(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -219,10 +225,10 @@ FLAC__bool OggFLAC__stream_encoder_set_loose_mid_side_stereo(OggFLAC__StreamEnco
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_loose_mid_side_stereo(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_loose_mid_side_stereo(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_channels(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -230,10 +236,10 @@ FLAC__bool OggFLAC__stream_encoder_set_channels(OggFLAC__StreamEncoder *encoder,
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_channels(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_channels(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_bits_per_sample(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -241,10 +247,10 @@ FLAC__bool OggFLAC__stream_encoder_set_bits_per_sample(OggFLAC__StreamEncoder *e
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_bits_per_sample(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_bits_per_sample(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_sample_rate(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -252,10 +258,10 @@ FLAC__bool OggFLAC__stream_encoder_set_sample_rate(OggFLAC__StreamEncoder *encod
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_sample_rate(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_sample_rate(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_blocksize(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -263,10 +269,10 @@ FLAC__bool OggFLAC__stream_encoder_set_blocksize(OggFLAC__StreamEncoder *encoder
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_blocksize(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_blocksize(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_max_lpc_order(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -274,10 +280,10 @@ FLAC__bool OggFLAC__stream_encoder_set_max_lpc_order(OggFLAC__StreamEncoder *enc
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_max_lpc_order(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_max_lpc_order(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_qlp_coeff_precision(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -285,10 +291,10 @@ FLAC__bool OggFLAC__stream_encoder_set_qlp_coeff_precision(OggFLAC__StreamEncode
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_qlp_coeff_precision(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_qlp_coeff_precision(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_do_qlp_coeff_prec_search(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -296,10 +302,10 @@ FLAC__bool OggFLAC__stream_encoder_set_do_qlp_coeff_prec_search(OggFLAC__StreamE
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_do_escape_coding(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -307,10 +313,10 @@ FLAC__bool OggFLAC__stream_encoder_set_do_escape_coding(OggFLAC__StreamEncoder *
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_do_escape_coding(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_do_escape_coding(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_do_exhaustive_model_search(OggFLAC__StreamEncoder *encoder, FLAC__bool value)
@@ -318,10 +324,10 @@ FLAC__bool OggFLAC__stream_encoder_set_do_exhaustive_model_search(OggFLAC__Strea
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_do_exhaustive_model_search(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_do_exhaustive_model_search(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_min_residual_partition_order(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -329,10 +335,10 @@ FLAC__bool OggFLAC__stream_encoder_set_min_residual_partition_order(OggFLAC__Str
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_min_residual_partition_order(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_min_residual_partition_order(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_max_residual_partition_order(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -340,10 +346,10 @@ FLAC__bool OggFLAC__stream_encoder_set_max_residual_partition_order(OggFLAC__Str
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_max_residual_partition_order(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_max_residual_partition_order(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_rice_parameter_search_dist(OggFLAC__StreamEncoder *encoder, unsigned value)
@@ -351,10 +357,10 @@ FLAC__bool OggFLAC__stream_encoder_set_rice_parameter_search_dist(OggFLAC__Strea
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_rice_parameter_search_dist(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_rice_parameter_search_dist(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_total_samples_estimate(OggFLAC__StreamEncoder *encoder, FLAC__uint64 value)
@@ -362,10 +368,10 @@ FLAC__bool OggFLAC__stream_encoder_set_total_samples_estimate(OggFLAC__StreamEnc
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_total_samples_estimate(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_total_samples_estimate(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_metadata(OggFLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks)
@@ -373,10 +379,10 @@ FLAC__bool OggFLAC__stream_encoder_set_metadata(OggFLAC__StreamEncoder *encoder,
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       FLAC__ASSERT(0 != encoder->private_->stream_encoder);
+       FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
        if(encoder->protected_->state != OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
                return false;
-       return FLAC__stream_encoder_set_metadata(encoder->private_->stream_encoder, value);
+       return FLAC__stream_encoder_set_metadata(encoder->private_->FLAC_stream_encoder, value);
 }
 
 FLAC__bool OggFLAC__stream_encoder_set_write_callback(OggFLAC__StreamEncoder *encoder, OggFLAC__StreamEncoderWriteCallback value)
@@ -415,7 +421,7 @@ FLAC__StreamEncoderState OggFLAC__stream_encoder_get_FLAC_stream_encoder_state(c
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_state(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_state(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__StreamDecoderState OggFLAC__stream_encoder_get_verify_decoder_state(const OggFLAC__StreamEncoder *encoder);
@@ -423,7 +429,7 @@ FLAC__StreamDecoderState OggFLAC__stream_encoder_get_verify_decoder_state(const
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_verify_decoder_state(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_verify(const OggFLAC__StreamEncoder *encoder)
@@ -431,7 +437,7 @@ FLAC__bool OggFLAC__stream_encoder_get_verify(const OggFLAC__StreamEncoder *enco
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_verify(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_verify(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_streamable_subset(const OggFLAC__StreamEncoder *encoder)
@@ -439,7 +445,7 @@ FLAC__bool OggFLAC__stream_encoder_get_streamable_subset(const OggFLAC__StreamEn
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_streamable_subset(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_streamable_subset(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_do_mid_side_stereo(const OggFLAC__StreamEncoder *encoder)
@@ -447,7 +453,7 @@ FLAC__bool OggFLAC__stream_encoder_get_do_mid_side_stereo(const OggFLAC__StreamE
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_do_mid_side_stereo(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_do_mid_side_stereo(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_loose_mid_side_stereo(const OggFLAC__StreamEncoder *encoder)
@@ -455,7 +461,7 @@ FLAC__bool OggFLAC__stream_encoder_get_loose_mid_side_stereo(const OggFLAC__Stre
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_loose_mid_side_stereo(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_loose_mid_side_stereo(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_channels(const OggFLAC__StreamEncoder *encoder)
@@ -463,7 +469,7 @@ unsigned OggFLAC__stream_encoder_get_channels(const OggFLAC__StreamEncoder *enco
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_channels(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_channels(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_bits_per_sample(const OggFLAC__StreamEncoder *encoder)
@@ -471,7 +477,7 @@ unsigned OggFLAC__stream_encoder_get_bits_per_sample(const OggFLAC__StreamEncode
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_bits_per_sample(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_bits_per_sample(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_sample_rate(const OggFLAC__StreamEncoder *encoder)
@@ -479,7 +485,7 @@ unsigned OggFLAC__stream_encoder_get_sample_rate(const OggFLAC__StreamEncoder *e
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_sample_rate(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_sample_rate(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_blocksize(const OggFLAC__StreamEncoder *encoder)
@@ -487,7 +493,7 @@ unsigned OggFLAC__stream_encoder_get_blocksize(const OggFLAC__StreamEncoder *enc
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_blocksize(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_blocksize(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_max_lpc_order(const OggFLAC__StreamEncoder *encoder)
@@ -495,7 +501,7 @@ unsigned OggFLAC__stream_encoder_get_max_lpc_order(const OggFLAC__StreamEncoder
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_max_lpc_order(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_max_lpc_order(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_qlp_coeff_precision(const OggFLAC__StreamEncoder *encoder)
@@ -503,7 +509,7 @@ unsigned OggFLAC__stream_encoder_get_qlp_coeff_precision(const OggFLAC__StreamEn
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_qlp_coeff_precision(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_qlp_coeff_precision(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_do_qlp_coeff_prec_search(const OggFLAC__StreamEncoder *encoder)
@@ -511,7 +517,7 @@ FLAC__bool OggFLAC__stream_encoder_get_do_qlp_coeff_prec_search(const OggFLAC__S
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_do_qlp_coeff_prec_search(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_do_qlp_coeff_prec_search(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_do_escape_coding(const OggFLAC__StreamEncoder *encoder)
@@ -519,7 +525,7 @@ FLAC__bool OggFLAC__stream_encoder_get_do_escape_coding(const OggFLAC__StreamEnc
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_do_escape_coding(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_do_escape_coding(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool OggFLAC__stream_encoder_get_do_exhaustive_model_search(const OggFLAC__StreamEncoder *encoder)
@@ -527,7 +533,7 @@ FLAC__bool OggFLAC__stream_encoder_get_do_exhaustive_model_search(const OggFLAC_
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_do_exhaustive_model_search(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_do_exhaustive_model_search(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_min_residual_partition_order(const OggFLAC__StreamEncoder *encoder)
@@ -535,7 +541,7 @@ unsigned OggFLAC__stream_encoder_get_min_residual_partition_order(const OggFLAC_
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_min_residual_partition_order(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_min_residual_partition_order(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_max_residual_partition_order(const OggFLAC__StreamEncoder *encoder)
@@ -543,7 +549,7 @@ unsigned OggFLAC__stream_encoder_get_max_residual_partition_order(const OggFLAC_
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_max_residual_partition_order(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_max_residual_partition_order(encoder->private_->FLAC_stream_encoder);
 }
 
 unsigned OggFLAC__stream_encoder_get_rice_parameter_search_dist(const OggFLAC__StreamEncoder *encoder)
@@ -551,7 +557,7 @@ unsigned OggFLAC__stream_encoder_get_rice_parameter_search_dist(const OggFLAC__S
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_rice_parameter_search_dist(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_rice_parameter_search_dist(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__uint64 OggFLAC__stream_encoder_get_total_samples_estimate(const OggFLAC__StreamEncoder *encoder)
@@ -559,7 +565,7 @@ FLAC__uint64 OggFLAC__stream_encoder_get_total_samples_estimate(const OggFLAC__S
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_get_total_samples_estimate(encoder->private_->encoder);
+       return FLAC__stream_encoder_get_total_samples_estimate(encoder->private_->FLAC_stream_encoder);
 }
 
 FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
@@ -567,7 +573,7 @@ FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_process(encoder->private_->encoder, buffer, samples);
+       return FLAC__stream_encoder_process(encoder->private_->FLAC_stream_encoder, buffer, samples);
 }
 
 FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples)
@@ -575,7 +581,7 @@ FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder
        FLAC__ASSERT(0 != encoder);
        FLAC__ASSERT(0 != encoder->private_);
        FLAC__ASSERT(0 != encoder->protected_);
-       return FLAC__stream_encoder_process_interleaved(encoder->private_->encoder, buffer, samples);
+       return FLAC__stream_encoder_process_interleaved(encoder->private_->FLAC_stream_encoder, buffer, samples);
 }
 
 /***********************************************************************