From 17e9cc84c5f94c94c71b2a808b57d4655ee21d12 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:07 +0200 Subject: added decoder_seek_where() and decoder_seek_error() Provide access to seeking for the decoder plugins; they have to know where to seek, and they need a way to tell us that seeking has failed. --- src/inputPlugins/flac_plugin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/inputPlugins/flac_plugin.c') diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index cef1f6ed0..b76327dc1 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -424,16 +424,16 @@ static int flac_decode_internal(struct decoder * decoder, if (flac_get_state(flacDec) == flac_decoder_eof) break; if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) { - FLAC__uint64 sampleToSeek = dc.seekWhere * + FLAC__uint64 sampleToSeek = decoder_seek_where(decoder) * data.audio_format.sampleRate + 0.5; if (flac_seek_absolute(flacDec, sampleToSeek)) { decoder_clear(decoder); data.time = ((float)sampleToSeek) / data.audio_format.sampleRate; data.position = 0; + decoder_command_finished(decoder); } else - dc.seekError = 1; - decoder_command_finished(decoder); + decoder_seek_error(decoder); } } if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) { -- cgit v1.2.3