aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-15 19:57:57 +0100
committerMax Kellermann <max@duempel.org>2009-01-15 19:57:57 +0100
commit15435b09affcd362cc047c54f6a3b052aa965889 (patch)
treebd38be4a2311c4f75ba2067abf677bb82db7d9c5 /src/decoder/flac_plugin.c
parent8307dd3e873e7ed7c72ae26ee7d2a8ea505c3336 (diff)
downloadmpd-15435b09affcd362cc047c54f6a3b052aa965889.tar.gz
mpd-15435b09affcd362cc047c54f6a3b052aa965889.tar.xz
mpd-15435b09affcd362cc047c54f6a3b052aa965889.zip
flac: use bool instead of int
Diffstat (limited to 'src/decoder/flac_plugin.c')
-rw-r--r--src/decoder/flac_plugin.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index a13042cf3..edf268331 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -136,34 +136,29 @@ static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
g_warning("%s\n", str);
}
-static int 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)
+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)
{
- int s = 1;
- s &= FLAC__seekable_stream_decoder_set_read_callback(dec, read_cb);
- s &= FLAC__seekable_stream_decoder_set_seek_callback(dec, seek_cb);
- s &= FLAC__seekable_stream_decoder_set_tell_callback(dec, tell_cb);
- s &= FLAC__seekable_stream_decoder_set_length_callback(dec, length_cb);
- s &= FLAC__seekable_stream_decoder_set_eof_callback(dec, eof_cb);
- s &= FLAC__seekable_stream_decoder_set_write_callback(dec, write_cb);
- s &= FLAC__seekable_stream_decoder_set_metadata_callback(dec,
- metadata_cb);
- s &= FLAC__seekable_stream_decoder_set_metadata_respond(dec,
- FLAC__METADATA_TYPE_VORBIS_COMMENT);
- s &= FLAC__seekable_stream_decoder_set_error_callback(dec, error_cb);
- s &= FLAC__seekable_stream_decoder_set_client_data(dec, data);
- if (!s || (FLAC__seekable_stream_decoder_init(dec) !=
- FLAC__SEEKABLE_STREAM_DECODER_OK))
- return 0;
- return 1;
+ 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)