diff options
author | Max Kellermann <max@duempel.org> | 2009-11-11 08:14:37 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-11 08:14:37 +0100 |
commit | 68f77e4163db78bbc3740555591b95aad824d82c (patch) | |
tree | 746420a3f28261e36a86b2e7b690dc13859bb5de /src/decoder | |
parent | 93a13b42dd3d792a32c5e256d5172cf7647a3fc5 (diff) | |
download | mpd-68f77e4163db78bbc3740555591b95aad824d82c.tar.gz mpd-68f77e4163db78bbc3740555591b95aad824d82c.tar.xz mpd-68f77e4163db78bbc3740555591b95aad824d82c.zip |
oggflac: rewind stream after FLAC detection
The oggflac plugin has been completely broken for quite a while and
nobody has noticed - maybe we should remove it?
Diffstat (limited to '')
-rw-r--r-- | src/decoder/oggflac_plugin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c index fedfdcb48..c0e7e35e1 100644 --- a/src/decoder/oggflac_plugin.c +++ b/src/decoder/oggflac_plugin.c @@ -272,6 +272,10 @@ oggflac_tag_dup(const char *file) return NULL; } + /* rewind the stream, because ogg_stream_type_detect() has + moved it */ + input_stream_seek(&input_stream, 0, SEEK_SET); + flac_data_init(&data, NULL, &input_stream); data.tag = tag_new(); @@ -300,6 +304,10 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream) if (ogg_stream_type_detect(input_stream) != FLAC) return; + /* rewind the stream, because ogg_stream_type_detect() has + moved it */ + input_stream_seek(input_stream, 0, SEEK_SET); + flac_data_init(&data, mpd_decoder, input_stream); if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) { |