diff options
author | Max Kellermann <max@duempel.org> | 2009-11-11 18:08:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-11 18:08:22 +0100 |
commit | 183725733a929e433c584d5c02016e0d299ced7a (patch) | |
tree | 3a30cfb22412597ed429bc02e49cee7592a630ae /src/decoder/flac_plugin.c | |
parent | 3c1bacbdbc9de48575755f2fc5435afee24531cd (diff) | |
download | mpd-183725733a929e433c584d5c02016e0d299ced7a.tar.gz mpd-183725733a929e433c584d5c02016e0d299ced7a.tar.xz mpd-183725733a929e433c584d5c02016e0d299ced7a.zip |
decoder/flac: emulate FLAC__stream_decoder_init_stream()
Remove the wrapper flac_init().
Diffstat (limited to '')
-rw-r--r-- | src/decoder/flac_plugin.c | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index f57d5419c..0a47b5d7f 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -150,31 +150,6 @@ static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state) g_warning("%s\n", str); } - -static bool -flac_init(FLAC__SeekableStreamDecoder *dec, - FLAC__SeekableStreamDecoderReadCallback read_cb, - FLAC__SeekableStreamDecoderSeekCallback seek_cb, - FLAC__SeekableStreamDecoderTellCallback tell_cb, - FLAC__SeekableStreamDecoderLengthCallback length_cb, - FLAC__SeekableStreamDecoderEofCallback eof_cb, - FLAC__SeekableStreamDecoderWriteCallback write_cb, - FLAC__SeekableStreamDecoderMetadataCallback metadata_cb, - FLAC__SeekableStreamDecoderErrorCallback error_cb, - void *data) -{ - return FLAC__seekable_stream_decoder_set_read_callback(dec, read_cb) && - FLAC__seekable_stream_decoder_set_seek_callback(dec, seek_cb) && - FLAC__seekable_stream_decoder_set_tell_callback(dec, tell_cb) && - FLAC__seekable_stream_decoder_set_length_callback(dec, length_cb) && - FLAC__seekable_stream_decoder_set_eof_callback(dec, eof_cb) && - FLAC__seekable_stream_decoder_set_write_callback(dec, write_cb) && - FLAC__seekable_stream_decoder_set_metadata_callback(dec, metadata_cb) && - FLAC__seekable_stream_decoder_set_metadata_respond(dec, FLAC__METADATA_TYPE_VORBIS_COMMENT) && - FLAC__seekable_stream_decoder_set_error_callback(dec, error_cb) && - FLAC__seekable_stream_decoder_set_client_data(dec, data) && - FLAC__seekable_stream_decoder_init(dec) == FLAC__SEEKABLE_STREAM_DECODER_OK; -} #else /* FLAC_API_VERSION_CURRENT >= 7 */ static void flacPrintErroredState(FLAC__StreamDecoderState state) { @@ -489,11 +464,18 @@ flac_decode_internal(struct decoder * decoder, goto fail; #endif } else { - if (!flac_init(flac_dec, flac_read_cb, - flac_seek_cb, flac_tell_cb, - flac_length_cb, flac_eof_cb, - flac_write_cb, flacMetadata, - flac_error_cb, (void *)&data)) { + FLAC__StreamDecoderInitStatus status = + FLAC__stream_decoder_init_stream(flac_dec, + flac_read_cb, + flac_seek_cb, + flac_tell_cb, + flac_length_cb, + flac_eof_cb, + flac_write_cb, + flacMetadata, + flac_error_cb, + (void *)&data); + if (status != FLAC__STREAM_DECODER_INIT_STATUS_OK) { err = "doing init()"; goto fail; } |