aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/flac_plugin.c')
-rw-r--r--src/decoder/flac_plugin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 0afa85431..ad64b7355 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -434,13 +434,14 @@ out:
static bool
oggflac_decode(struct decoder *decoder, struct input_stream *inStream)
{
- return flac_decode_internal(decoder, inStream, true);
-}
+ if (ogg_stream_type_detect(inStream) != FLAC)
+ return false;
-static bool
-oggflac_try_decode(struct input_stream *inStream)
-{
- return ogg_stream_type_detect(inStream) == FLAC;
+ /* rewind the stream, because ogg_stream_type_detect() has
+ moved it */
+ input_stream_seek(inStream, 0, SEEK_SET);
+
+ return flac_decode_internal(decoder, inStream, true);
}
static const char *const oggflac_suffixes[] = { "ogg", "oga", NULL };
@@ -457,7 +458,6 @@ const struct decoder_plugin oggflacPlugin = {
.name = "oggflac",
.init = oggflac_init,
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
- .try_decode = oggflac_try_decode,
.stream_decode = oggflac_decode,
.tag_dup = oggflac_tag_dup,
.suffixes = oggflac_suffixes,