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

fix with new status enums

parent 36a31299
......@@ -563,22 +563,22 @@ FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder,
*bytes = 0;
if (stream_info->abort_flag)
return FLAC__STREAM_DECODER_READ_ABORT;
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
oggbuf = ogg_sync_buffer(&stream_info->ogg.oy, OGG_READ_BUFFER_SIZE);
(void)decoder; /* avoid compiler warning */
if(feof(fin))
return FLAC__STREAM_DECODER_READ_END_OF_STREAM;
return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
bytes_read = fread(oggbuf, 1, OGG_READ_BUFFER_SIZE, fin);
if(ferror(fin))
return FLAC__STREAM_DECODER_READ_ABORT;
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
if(ogg_sync_wrote(&stream_info->ogg.oy, bytes_read) < 0)
return FLAC__STREAM_DECODER_READ_ABORT;
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
while(ogg_sync_pageout(&stream_info->ogg.oy, &og) == 1) {
if(ogg_stream_pagein(&stream_info->ogg.os, &og) == 0) {
......@@ -590,11 +590,11 @@ FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder,
offset += op.bytes;
}
} else {
return FLAC__STREAM_DECODER_READ_ABORT;
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
}
}
return FLAC__STREAM_DECODER_READ_CONTINUE;
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
#endif
......@@ -616,7 +616,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const void *decoder, const FLAC__F
(void)decoder;
if(stream_info->abort_flag)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
stream_info->samples_processed += wide_samples;
stream_info->frame_counter++;
......@@ -640,7 +640,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const void *decoder, const FLAC__F
s8buffer[sample] = (FLAC__int8)(buffer[channel][wide_sample]);
}
if(fwrite(u8buffer, 1, sample, fout) != sample)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
else if(bps == 16) {
if(is_unsigned_samples) {
......@@ -663,7 +663,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const void *decoder, const FLAC__F
}
}
if(fwrite(u16buffer, 2, sample, fout) != sample)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
else if(bps == 24) {
if(is_unsigned_samples) {
......@@ -709,13 +709,13 @@ FLAC__StreamDecoderWriteStatus write_callback(const void *decoder, const FLAC__F
}
}
if(fwrite(u8buffer, 3, sample, fout) != sample)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
else {
FLAC__ASSERT(0);
}
}
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
void metadata_callback(const void *decoder, const FLAC__StreamMetaData *metadata, void *client_data)
......
......@@ -1194,7 +1194,7 @@ FLAC__StreamDecoderReadStatus verify_read_callback(const FLAC__StreamDecoder *de
encoder_wrapper->verify_fifo.encoded_bytes -= *bytes;
}
return FLAC__STREAM_DECODER_READ_CONTINUE;
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
FLAC__StreamDecoderWriteStatus verify_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *buffer[], void *client_data)
......@@ -1224,7 +1224,7 @@ FLAC__StreamDecoderWriteStatus verify_write_callback(const FLAC__StreamDecoder *
FLAC__ASSERT(l < r);
FLAC__ASSERT(frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER);
fprintf(stderr, " Absolute sample=%u, frame=%u, channel=%u, sample=%u, expected %d, got %d\n", (unsigned)frame->header.number.sample_number + sample, (unsigned)frame->header.number.sample_number / FLAC__stream_decoder_get_blocksize(decoder), channel, sample, expect, got); /*@@@ WATCHOUT: 4GB limit */
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
}
/* dequeue the frame from the fifo */
......@@ -1234,7 +1234,7 @@ FLAC__StreamDecoderWriteStatus verify_write_callback(const FLAC__StreamDecoder *
}
}
encoder_wrapper->verify_fifo.tail -= frame->header.blocksize;
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
void verify_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data)
......
......@@ -388,7 +388,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__FileDecoder *decoder,
(void)decoder;
if(stream_info->abort_flag)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
for(sample = samples_in_reservoir*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)
for(channel = 0; channel < channels; channel++, sample++)
......@@ -396,7 +396,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__FileDecoder *decoder,
samples_in_reservoir += wide_samples;
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
void metadata_callback(const FLAC__FileDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data)
......@@ -423,6 +423,6 @@ void error_callback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorSt
{
stream_info_struct *stream_info = (stream_info_struct *)client_data;
(void)decoder;
if(status != FLAC__STREAM_DECODER_ERROR_LOST_SYNC)
if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
stream_info->abort_flag = true;
}
......@@ -264,7 +264,7 @@ FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStrea
(void)decoder;
if(instance->abort_flag)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
for(sample = instance->samples_in_reservoir*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)
for(channel = 0; channel < channels; channel++, sample++)
......@@ -272,7 +272,7 @@ FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStrea
instance->samples_in_reservoir += wide_samples;
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data)
......@@ -294,7 +294,7 @@ void FlacPcm::errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__S
{
FlacPcm *instance = (FlacPcm*)client_data;
(void)decoder;
if(status != FLAC__STREAM_DECODER_ERROR_LOST_SYNC)
if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
instance->abort_flag = true;
}
......
......@@ -399,7 +399,7 @@ FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder,
(void)decoder;
if(file_info->abort_flag)
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
if(bps == 8) {
for(sample = reservoir_samples_*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)
......@@ -413,12 +413,12 @@ FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder,
}
else {
file_info->abort_flag = true;
return FLAC__STREAM_DECODER_WRITE_ABORT;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
reservoir_samples_ += wide_samples;
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data)
......@@ -450,6 +450,6 @@ void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorS
{
file_info_struct *file_info = (file_info_struct *)client_data;
(void)decoder;
if(status != FLAC__STREAM_DECODER_ERROR_LOST_SYNC)
if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
file_info->abort_flag = true;
}
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