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?
This commit is contained in:
Max Kellermann 2009-11-11 08:14:37 +01:00
parent 93a13b42dd
commit 68f77e4163
2 changed files with 9 additions and 0 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ ver 0.15.6 (2009/??/??)
- zzip: require libzzip 0.13 - zzip: require libzzip 0.13
* decoders: * decoders:
- ffmpeg: convert metadata - ffmpeg: convert metadata
- oggflac: rewind stream after FLAC detection
* output_thread: check again if output is open on PAUSE * output_thread: check again if output is open on PAUSE
* update: delete ignored symlinks from database * update: delete ignored symlinks from database
* database: increased maximum line length to 32 kB * database: increased maximum line length to 32 kB

View File

@ -272,6 +272,10 @@ oggflac_tag_dup(const char *file)
return NULL; 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); flac_data_init(&data, NULL, &input_stream);
data.tag = tag_new(); 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) if (ogg_stream_type_detect(input_stream) != FLAC)
return; 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); flac_data_init(&data, mpd_decoder, input_stream);
if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) { if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) {