various fixes related to deriving OggFLAC__SeekableStreamEncoder from FLAC__StreamEncoder instead of FLAC__SeekableStreamEncoder
This commit is contained in:
parent
173102739a
commit
b71b56cb4b
@ -230,7 +230,6 @@ namespace OggFLAC {
|
||||
bool set_metadata(::FLAC__StreamMetadata **metadata, unsigned num_blocks);
|
||||
|
||||
State get_state() const;
|
||||
FLAC::Encoder::SeekableStream::State get_FLAC_seekable_stream_encoder_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);
|
||||
@ -334,7 +333,6 @@ namespace OggFLAC {
|
||||
|
||||
State get_state() const;
|
||||
SeekableStream::State get_seekable_stream_encoder_state() const;
|
||||
FLAC::Encoder::SeekableStream::State get_FLAC_seekable_stream_encoder_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);
|
||||
|
@ -511,27 +511,11 @@ OggFLAC_API OggFLAC__FileEncoderState OggFLAC__file_encoder_get_state(const OggF
|
||||
*/
|
||||
OggFLAC_API OggFLAC__SeekableStreamEncoderState OggFLAC__file_encoder_get_seekable_stream_encoder_state(const OggFLAC__FileEncoder *encoder);
|
||||
|
||||
/** Get the state of the underlying FLAC seekable stream encoder.
|
||||
* Useful when the file encoder state is
|
||||
* \c OggFLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR
|
||||
* and the seekable stream encoder state is
|
||||
* \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \retval FLAC__SeekableStreamEncoderState
|
||||
* The seekable stream encoder state.
|
||||
*/
|
||||
OggFLAC_API FLAC__SeekableStreamEncoderState OggFLAC__file_encoder_get_FLAC_seekable_stream_encoder_state(const OggFLAC__FileEncoder *encoder);
|
||||
|
||||
/** Get the state of the underlying FLAC stream encoder.
|
||||
* Useful when the file encoder state is
|
||||
* \c OggFLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR
|
||||
* and the seekable stream encoder state is
|
||||
* \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR
|
||||
* and the FLAC seekable stream encoder state is
|
||||
* \c FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR.
|
||||
* \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
* \assert
|
||||
@ -545,9 +529,7 @@ OggFLAC_API FLAC__StreamEncoderState OggFLAC__file_encoder_get_FLAC_stream_encod
|
||||
* Useful when the file encoder state is
|
||||
* \c OggFLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR
|
||||
* and the seekable stream encoder state is
|
||||
* \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR
|
||||
* and the FLAC seekable stream encoder state is
|
||||
* \c FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR
|
||||
* \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR
|
||||
* and the FLAC stream encoder state is
|
||||
* \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
|
||||
*
|
||||
|
@ -189,12 +189,6 @@ namespace OggFLAC {
|
||||
return SeekableStream::State(::OggFLAC__file_encoder_get_seekable_stream_encoder_state(encoder_));
|
||||
}
|
||||
|
||||
FLAC::Encoder::SeekableStream::State File::get_FLAC_seekable_stream_encoder_state() const
|
||||
{
|
||||
FLAC__ASSERT(is_valid());
|
||||
return FLAC::Encoder::SeekableStream::State(::OggFLAC__file_encoder_get_FLAC_seekable_stream_encoder_state(encoder_));
|
||||
}
|
||||
|
||||
FLAC::Encoder::Stream::State File::get_FLAC_stream_encoder_state() const
|
||||
{
|
||||
FLAC__ASSERT(is_valid());
|
||||
|
@ -177,12 +177,6 @@ namespace OggFLAC {
|
||||
return State(::OggFLAC__seekable_stream_encoder_get_state(encoder_));
|
||||
}
|
||||
|
||||
FLAC::Encoder::SeekableStream::State SeekableStream::get_FLAC_seekable_stream_encoder_state() const
|
||||
{
|
||||
FLAC__ASSERT(is_valid());
|
||||
return FLAC::Encoder::SeekableStream::State(::OggFLAC__seekable_stream_encoder_get_FLAC_seekable_stream_encoder_state(encoder_));
|
||||
}
|
||||
|
||||
FLAC::Encoder::Stream::State SeekableStream::get_FLAC_stream_encoder_state() const
|
||||
{
|
||||
FLAC__ASSERT(is_valid());
|
||||
|
@ -425,16 +425,12 @@ bool SeekableStreamEncoder::die(const char *msg) const
|
||||
printf("FAILED");
|
||||
|
||||
printf(", state = %u (%s)\n", (unsigned)((::OggFLAC__SeekableStreamEncoderState)state), state.as_cstring());
|
||||
if(state == ::OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::SeekableStream::State state_ = get_FLAC_seekable_stream_encoder_state();
|
||||
printf(" FLAC seekable stream encoder state = %u (%s)\n", (unsigned)((::FLAC__SeekableStreamEncoderState)state_), state_.as_cstring());
|
||||
if(state_ == ::FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::Stream::State state__ = get_FLAC_stream_encoder_state();
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state__), state__.as_cstring());
|
||||
if(state__ == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC::Decoder::Stream::State dstate = get_verify_decoder_state();
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
|
||||
}
|
||||
if(state == ::OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::Stream::State state_ = get_FLAC_stream_encoder_state();
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state_), state_.as_cstring());
|
||||
if(state_ == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC::Decoder::Stream::State dstate = get_verify_decoder_state();
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
|
||||
}
|
||||
}
|
||||
|
||||
@ -569,13 +565,9 @@ static bool test_seekable_stream_encoder()
|
||||
OggFLAC::Encoder::SeekableStream::State state = encoder->get_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::OggFLAC__SeekableStreamEncoderState)state), state.as_cstring());
|
||||
|
||||
printf("testing get_FLAC_seekable_stream_encoder_state()... ");
|
||||
FLAC::Encoder::SeekableStream::State state_ = encoder->get_FLAC_seekable_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__SeekableStreamEncoderState)state_), state_.as_cstring());
|
||||
|
||||
printf("testing get_FLAC_stream_encoder_state()... ");
|
||||
FLAC::Encoder::Stream::State state__ = encoder->get_FLAC_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state__), state__.as_cstring());
|
||||
FLAC::Encoder::Stream::State state_ = encoder->get_FLAC_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state_), state_.as_cstring());
|
||||
|
||||
printf("testing get_verify_decoder_state()... ");
|
||||
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
|
||||
@ -766,16 +758,12 @@ bool FileEncoder::die(const char *msg) const
|
||||
if(state == ::OggFLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
OggFLAC::Encoder::SeekableStream::State state_ = get_seekable_stream_encoder_state();
|
||||
printf(" seekable stream encoder state = %u (%s)\n", (unsigned)((::OggFLAC__SeekableStreamEncoderState)state_), state_.as_cstring());
|
||||
if(state_ == ::OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::SeekableStream::State state__ = get_FLAC_seekable_stream_encoder_state();
|
||||
printf(" FLAC seekable stream encoder state = %u (%s)\n", (unsigned)((::FLAC__SeekableStreamEncoderState)state__), state__.as_cstring());
|
||||
if(state__ == ::FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::Stream::State state___ = get_FLAC_stream_encoder_state();
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state___), state___.as_cstring());
|
||||
if(state___ == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC::Decoder::Stream::State dstate = get_verify_decoder_state();
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
|
||||
}
|
||||
if(state_ == ::OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR) {
|
||||
FLAC::Encoder::Stream::State state__ = get_FLAC_stream_encoder_state();
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state__), state__.as_cstring());
|
||||
if(state__ == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC::Decoder::Stream::State dstate = get_verify_decoder_state();
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -920,13 +908,9 @@ static bool test_file_encoder()
|
||||
OggFLAC::Encoder::SeekableStream::State state_ = encoder->get_seekable_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::OggFLAC__SeekableStreamEncoderState)state_), state_.as_cstring());
|
||||
|
||||
printf("testing get_FLAC_seekable_stream_encoder_state()... ");
|
||||
FLAC::Encoder::SeekableStream::State state__ = encoder->get_FLAC_seekable_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__SeekableStreamEncoderState)state__), state__.as_cstring());
|
||||
|
||||
printf("testing get_FLAC_stream_encoder_state()... ");
|
||||
FLAC::Encoder::Stream::State state___ = encoder->get_FLAC_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state___), state___.as_cstring());
|
||||
FLAC::Encoder::Stream::State state__ = encoder->get_FLAC_stream_encoder_state();
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state__), state__.as_cstring());
|
||||
|
||||
printf("testing get_verify_decoder_state()... ");
|
||||
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
|
||||
|
@ -65,16 +65,12 @@ static FLAC__bool die_ss_(const char *msg, const OggFLAC__SeekableStreamEncoder
|
||||
printf("FAILED");
|
||||
|
||||
printf(", state = %u (%s)\n", (unsigned)state, OggFLAC__SeekableStreamEncoderStateString[state]);
|
||||
if(state == OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
FLAC__SeekableStreamEncoderState state_ = OggFLAC__seekable_stream_encoder_get_FLAC_seekable_stream_encoder_state(encoder);
|
||||
printf(" FLAC seekable stream encoder state = %u (%s)\n", (unsigned)state_, FLAC__SeekableStreamEncoderStateString[state_]);
|
||||
if(state_ == FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR) {
|
||||
FLAC__StreamEncoderState state__ = OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)state__, FLAC__StreamEncoderStateString[state__]);
|
||||
if(state__ == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC__StreamDecoderState dstate = OggFLAC__seekable_stream_encoder_get_verify_decoder_state(encoder);
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
|
||||
}
|
||||
if(state == OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR) {
|
||||
FLAC__StreamEncoderState state_ = OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)state_, FLAC__StreamEncoderStateString[state_]);
|
||||
if(state_ == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC__StreamDecoderState dstate = OggFLAC__seekable_stream_encoder_get_verify_decoder_state(encoder);
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,16 +90,12 @@ static FLAC__bool die_f_(const char *msg, const OggFLAC__FileEncoder *encoder)
|
||||
if(state == OggFLAC__FILE_ENCODER_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
OggFLAC__SeekableStreamEncoderState state_ = OggFLAC__file_encoder_get_seekable_stream_encoder_state(encoder);
|
||||
printf(" seekable stream encoder state = %u (%s)\n", (unsigned)state_, OggFLAC__SeekableStreamEncoderStateString[state_]);
|
||||
if(state_ == OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_SEEKABLE_STREAM_ENCODER_ERROR) {
|
||||
FLAC__SeekableStreamEncoderState state__ = OggFLAC__file_encoder_get_FLAC_seekable_stream_encoder_state(encoder);
|
||||
printf(" FLAC seekable stream encoder state = %u (%s)\n", (unsigned)state__, FLAC__SeekableStreamEncoderStateString[state__]);
|
||||
if(state__ == FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR) {
|
||||
FLAC__StreamEncoderState state___ = OggFLAC__file_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)state___, FLAC__StreamEncoderStateString[state___]);
|
||||
if(state___ == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC__StreamDecoderState dstate = OggFLAC__file_encoder_get_verify_decoder_state(encoder);
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
|
||||
}
|
||||
if(state_ == OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR) {
|
||||
FLAC__StreamEncoderState state__ = OggFLAC__file_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf(" FLAC stream encoder state = %u (%s)\n", (unsigned)state__, FLAC__StreamEncoderStateString[state__]);
|
||||
if(state__ == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
|
||||
FLAC__StreamDecoderState dstate = OggFLAC__file_encoder_get_verify_decoder_state(encoder);
|
||||
printf(" verify decoder state = %u (%s)\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -462,7 +454,6 @@ static FLAC__bool test_seekable_stream_encoder()
|
||||
{
|
||||
OggFLAC__SeekableStreamEncoder *encoder;
|
||||
OggFLAC__SeekableStreamEncoderState state;
|
||||
FLAC__SeekableStreamEncoderState fsstate;
|
||||
FLAC__StreamEncoderState fstate;
|
||||
FLAC__StreamDecoderState dstate;
|
||||
FLAC__int32 samples[1024];
|
||||
@ -605,10 +596,6 @@ static FLAC__bool test_seekable_stream_encoder()
|
||||
state = OggFLAC__seekable_stream_encoder_get_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)state, OggFLAC__SeekableStreamEncoderStateString[state]);
|
||||
|
||||
printf("testing OggFLAC__seekable_stream_encoder_get_FLAC_seekable_stream_encoder_state()... ");
|
||||
fsstate = OggFLAC__seekable_stream_encoder_get_FLAC_seekable_stream_encoder_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)fsstate, FLAC__SeekableStreamEncoderStateString[fsstate]);
|
||||
|
||||
printf("testing OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state()... ");
|
||||
fstate = OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)fstate, FLAC__StreamEncoderStateString[fstate]);
|
||||
@ -784,7 +771,6 @@ static FLAC__bool test_file_encoder()
|
||||
OggFLAC__FileEncoder *encoder;
|
||||
OggFLAC__FileEncoderState state;
|
||||
OggFLAC__SeekableStreamEncoderState sstate;
|
||||
FLAC__SeekableStreamEncoderState fsstate;
|
||||
FLAC__StreamEncoderState fstate;
|
||||
FLAC__StreamDecoderState dstate;
|
||||
FLAC__int32 samples[1024];
|
||||
@ -926,10 +912,6 @@ static FLAC__bool test_file_encoder()
|
||||
sstate = OggFLAC__file_encoder_get_seekable_stream_encoder_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)sstate, OggFLAC__SeekableStreamEncoderStateString[sstate]);
|
||||
|
||||
printf("testing OggFLAC__file_encoder_get_FLAC_seekable_stream_encoder_state()... ");
|
||||
fsstate = OggFLAC__file_encoder_get_FLAC_seekable_stream_encoder_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)fsstate, FLAC__SeekableStreamEncoderStateString[fsstate]);
|
||||
|
||||
printf("testing OggFLAC__file_encoder_get_FLAC_stream_encoder_state()... ");
|
||||
fstate = OggFLAC__file_encoder_get_FLAC_stream_encoder_state(encoder);
|
||||
printf("returned state = %u (%s)... OK\n", (unsigned)fstate, FLAC__StreamEncoderStateString[fstate]);
|
||||
|
Loading…
Reference in New Issue
Block a user