Commit d65d6548 authored by Max Kellermann's avatar Max Kellermann

oggflac: adapt to new API

Again, I forgot to adapt oggflac to the new API (struct input_stream, bool return values).
parent 5024f0b6
...@@ -256,7 +256,7 @@ fail: ...@@ -256,7 +256,7 @@ fail:
/* public functions: */ /* public functions: */
static struct tag *oggflac_TagDup(char *file) static struct tag *oggflac_TagDup(char *file)
{ {
InputStream inStream; struct input_stream inStream;
OggFLAC__SeekableStreamDecoder *decoder; OggFLAC__SeekableStreamDecoder *decoder;
FlacData data; FlacData data;
...@@ -279,7 +279,7 @@ static struct tag *oggflac_TagDup(char *file) ...@@ -279,7 +279,7 @@ static struct tag *oggflac_TagDup(char *file)
return data.tag; return data.tag;
} }
static bool oggflac_try_decode(InputStream * inStream) static bool oggflac_try_decode(struct input_stream *inStream)
{ {
if (!inStream->seekable) if (!inStream->seekable)
/* we cannot seek after the detection, so don't bother /* we cannot seek after the detection, so don't bother
...@@ -289,16 +289,17 @@ static bool oggflac_try_decode(InputStream * inStream) ...@@ -289,16 +289,17 @@ static bool oggflac_try_decode(InputStream * inStream)
return ogg_stream_type_detect(inStream) == FLAC; 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; OggFLAC__SeekableStreamDecoder *decoder = NULL;
FlacData data; FlacData data;
int ret = 0; bool ret = true;
init_FlacData(&data, mpd_decoder, inStream); init_FlacData(&data, mpd_decoder, inStream);
if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) { if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) {
ret = -1; ret = false;
goto fail; goto fail;
} }
...@@ -315,7 +316,6 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream) ...@@ -315,7 +316,6 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
data.audio_format.sample_rate + 0.5; data.audio_format.sample_rate + 0.5;
if (OggFLAC__seekable_stream_decoder_seek_absolute if (OggFLAC__seekable_stream_decoder_seek_absolute
(decoder, sampleToSeek)) { (decoder, sampleToSeek)) {
decoder_clear(mpd_decoder);
data.time = ((float)sampleToSeek) / data.time = ((float)sampleToSeek) /
data.audio_format.sample_rate; data.audio_format.sample_rate;
data.position = 0; data.position = 0;
......
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