+++ /dev/null
---- moc-2.4.1/decoder_plugins/flac/flac.c.orig 2007-01-01 22:55:40.000000000 +0000
-+++ moc-2.4.1/decoder_plugins/flac/flac.c 2007-01-01 23:26:56.000000000 +0000
-@@ -19,6 +19,7 @@
-
- #include <string.h>
- #include <FLAC/all.h>
-+#include <FLAC/stream_decoder.h>
- #include <stdlib.h>
- #include <strings.h>
- #include "audio.h"
-@@ -35,7 +36,7 @@
-
- struct flac_data
- {
-- FLAC__SeekableStreamDecoder *decoder;
-+ FLAC__StreamDecoder *decoder;
- struct io_stream *stream;
- int bitrate;
- int abort; /* abort playing (due to an error) */
-@@ -109,7 +110,7 @@
- }
-
- static FLAC__StreamDecoderWriteStatus write_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- const FLAC__Frame *frame,
- const FLAC__int32 * const buffer[], void *client_data)
- {
-@@ -127,7 +128,7 @@
- }
-
- static void metadata_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- const FLAC__StreamMetadata *metadata, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-@@ -147,7 +148,7 @@
- }
-
- static void error_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- FLAC__StreamDecoderErrorStatus status, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-@@ -160,8 +161,8 @@
- decoder_error (&data->error, ERROR_FATAL, 0, "FLAC: lost sync");
- }
-
--static FLAC__SeekableStreamDecoderReadStatus read_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+static FLAC__StreamDecoderReadStatus read_callback (
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- FLAC__byte buffer[], unsigned *bytes, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-@@ -184,39 +185,39 @@
- return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
- }
-
--static FLAC__SeekableStreamDecoderSeekStatus seek_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+static FLAC__StreamDecoderSeekStatus seek_callback (
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- FLAC__uint64 absolute_byte_offset, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-
- return io_seek(data->stream, absolute_byte_offset, SEEK_SET) >= 0
-- ? FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK
-- : FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
-+ ? FLAC__STREAM_DECODER_SEEK_STATUS_OK
-+ : FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
- }
-
--static FLAC__SeekableStreamDecoderTellStatus tell_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+static FLAC__StreamDecoderTellStatus tell_callback (
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- FLAC__uint64 *absolute_byte_offset, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-
- *absolute_byte_offset = io_tell (data->stream);
-- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
-+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
- }
-
--static FLAC__SeekableStreamDecoderLengthStatus length_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+static FLAC__StreamDecoderLengthStatus length_callback (
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- FLAC__uint64 *stream_length, void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-
- *stream_length = io_file_size (data->stream);
-- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
-+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
- }
-
- static FLAC__bool eof_callback (
-- const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED,
-+ const FLAC__StreamDecoder *decoder ATTR_UNUSED,
- void *client_data)
- {
- struct flac_data *data = (struct flac_data *)client_data;
-@@ -248,48 +249,41 @@
-
- data->ok = 1;
-
-- if (!(data->decoder = FLAC__seekable_stream_decoder_new())) {
-+ if (!(data->decoder = FLAC__stream_decoder_new())) {
- decoder_error (&data->error, ERROR_FATAL, 0,
-- "FLAC__seekable_stream_decoder_new() failed");
-+ "FLAC__stream_decoder_new() failed");
- data->ok = 0;
- return data;
- }
-
-- FLAC__seekable_stream_decoder_set_md5_checking (data->decoder, false);
-+ FLAC__stream_decoder_set_md5_checking (data->decoder, false);
-
-- FLAC__seekable_stream_decoder_set_metadata_ignore_all (data->decoder);
-- FLAC__seekable_stream_decoder_set_metadata_respond (data->decoder,
-+ FLAC__stream_decoder_set_metadata_ignore_all (data->decoder);
-+ FLAC__stream_decoder_set_metadata_respond (data->decoder,
- FLAC__METADATA_TYPE_STREAMINFO);
-- FLAC__seekable_stream_decoder_set_client_data (data->decoder, data);
-- FLAC__seekable_stream_decoder_set_metadata_callback (data->decoder,
-- metadata_callback);
-- FLAC__seekable_stream_decoder_set_write_callback (data->decoder,
-- write_callback);
-- FLAC__seekable_stream_decoder_set_error_callback (data->decoder,
-- error_callback);
-- FLAC__seekable_stream_decoder_set_read_callback (data->decoder,
-- read_callback);
-- FLAC__seekable_stream_decoder_set_seek_callback (data->decoder,
-- seek_callback);
-- FLAC__seekable_stream_decoder_set_tell_callback (data->decoder,
-- tell_callback);
-- FLAC__seekable_stream_decoder_set_length_callback (data->decoder,
-- length_callback);
-- FLAC__seekable_stream_decoder_set_eof_callback (data->decoder,
-- eof_callback);
-
-- if (FLAC__seekable_stream_decoder_init(data->decoder)
-- != FLAC__FILE_DECODER_OK) {
-+ if (FLAC__stream_decoder_init_stream(
-+ data->decoder,
-+ read_callback,
-+ seek_callback,
-+ tell_callback,
-+ length_callback,
-+ eof_callback,
-+ write_callback,
-+ metadata_callback,
-+ error_callback,
-+ data)
-+ != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
- decoder_error (&data->error, ERROR_FATAL, 0,
-- "FLAC__seekable_stream_decoder_init() failed");
-+ "FLAC__stream_decoder_init() failed");
- data->ok = 0;
- return data;
- }
-
-- if (!FLAC__seekable_stream_decoder_process_until_end_of_metadata(
-+ if (!FLAC__stream_decoder_process_until_end_of_metadata(
- data->decoder)) {
- decoder_error (&data->error, ERROR_FATAL, 0,
-- "FLAC__seekable_stream_decoder_process_until_end_of_metadata()"
-+ "FLAC__stream_decoder_process_until_end_of_metadata()"
- " failed.");
- data->ok = 0;
- return data;
-@@ -309,8 +303,8 @@
-
- if (data->ok) {
- if (data->decoder) {
-- FLAC__seekable_stream_decoder_finish (data->decoder);
-- FLAC__seekable_stream_decoder_delete (data->decoder);
-+ FLAC__stream_decoder_finish (data->decoder);
-+ FLAC__stream_decoder_delete (data->decoder);
- }
- io_close (data->stream);
- }
-@@ -430,11 +424,11 @@
- target_sample = (FLAC__uint64)((sec/(double)data->length) *
- (double)data->total_samples);
-
-- if (FLAC__seekable_stream_decoder_seek_absolute(data->decoder,
-+ if (FLAC__stream_decoder_seek_absolute(data->decoder,
- target_sample))
- return sec;
- else {
-- logit ("FLAC__seekable_stream_decoder_seek_absolute() failed.");
-+ logit ("FLAC__stream_decoder_seek_absolute() failed.");
- return -1;
- }
- }
-@@ -469,13 +463,13 @@
- if (!data->sample_buffer_fill) {
- debug ("decoding...");
-
-- if (FLAC__seekable_stream_decoder_get_state(data->decoder)
-- == FLAC__FILE_DECODER_END_OF_FILE) {
-+ if (FLAC__stream_decoder_get_state(data->decoder)
-+ == FLAC__STREAM_DECODER_END_OF_STREAM) {
- logit ("EOF");
- return 0;
- }
-
-- if (!FLAC__seekable_stream_decoder_process_single(
-+ if (!FLAC__stream_decoder_process_single(
- data->decoder)) {
- decoder_error (&data->error, ERROR_FATAL, 0,
- "Read error processing frame.");
-@@ -483,7 +477,7 @@
- }
-
- /* Count the bitrate */
-- if(!FLAC__seekable_stream_decoder_get_decode_position(
-+ if(!FLAC__stream_decoder_get_decode_position(
- data->decoder, &decode_position))
- decode_position = 0;
- if (decode_position > data->last_decode_position) {