aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-31 08:52:09 +0100
committerMax Kellermann <max@duempel.org>2008-10-31 08:52:09 +0100
commitd65d6548a3639ce86242c570c3b812395db91648 (patch)
treea5b56388e9cc97183fa92aee08a5dd7a4e8c7ce1
parent5024f0b6cc5151b28cc2e7be1648c2664595e86e (diff)
downloadmpd-d65d6548a3639ce86242c570c3b812395db91648.tar.gz
mpd-d65d6548a3639ce86242c570c3b812395db91648.tar.xz
mpd-d65d6548a3639ce86242c570c3b812395db91648.zip
oggflac: adapt to new API
Again, I forgot to adapt oggflac to the new API (struct input_stream, bool return values).
-rw-r--r--src/decoder/oggflac_plugin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c
index 87e21e146..d50575bea 100644
--- a/src/decoder/oggflac_plugin.c
+++ b/src/decoder/oggflac_plugin.c
@@ -256,7 +256,7 @@ fail:
/* public functions: */
static struct tag *oggflac_TagDup(char *file)
{
- InputStream inStream;
+ struct input_stream inStream;
OggFLAC__SeekableStreamDecoder *decoder;
FlacData data;
@@ -279,7 +279,7 @@ static struct tag *oggflac_TagDup(char *file)
return data.tag;
}
-static bool oggflac_try_decode(InputStream * inStream)
+static bool oggflac_try_decode(struct input_stream *inStream)
{
if (!inStream->seekable)
/* we cannot seek after the detection, so don't bother
@@ -289,16 +289,17 @@ static bool oggflac_try_decode(InputStream * inStream)
return ogg_stream_type_detect(inStream) == FLAC;
}
-static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
+static bool
+oggflac_decode(struct decoder * mpd_decoder, struct input_stream *inStream)
{
OggFLAC__SeekableStreamDecoder *decoder = NULL;
FlacData data;
- int ret = 0;
+ bool ret = true;
init_FlacData(&data, mpd_decoder, inStream);
if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) {
- ret = -1;
+ ret = false;
goto fail;
}
@@ -315,7 +316,6 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
data.audio_format.sample_rate + 0.5;
if (OggFLAC__seekable_stream_decoder_seek_absolute
(decoder, sampleToSeek)) {
- decoder_clear(mpd_decoder);
data.time = ((float)sampleToSeek) /
data.audio_format.sample_rate;
data.position = 0;