From bad350bc18ab81661253bf42245b9e3fa175d026 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Dec 2009 19:47:33 +0100 Subject: decoder_api: added function decoder_timestamp() Remove the data_time parameter from decoder_data(). This patch eliminates the timestamp counting in most decoder plugins, because the MPD core will do it automatically by default. --- src/decoder/audiofile_plugin.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/decoder/audiofile_plugin.c') diff --git a/src/decoder/audiofile_plugin.c b/src/decoder/audiofile_plugin.c index a1fefcb0d..18cfdda5d 100644 --- a/src/decoder/audiofile_plugin.c +++ b/src/decoder/audiofile_plugin.c @@ -160,7 +160,7 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is) struct audio_format audio_format; float total_time; uint16_t bit_rate; - int ret, current = 0; + int ret; char chunk[CHUNK_SIZE]; enum decoder_command cmd; @@ -204,17 +204,14 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is) if (ret <= 0) break; - current += ret; cmd = decoder_data(decoder, NULL, chunk, ret * fs, - (float)current / - (float)audio_format.sample_rate, bit_rate, NULL); if (cmd == DECODE_COMMAND_SEEK) { - current = decoder_seek_where(decoder) * + AFframecount frame = decoder_seek_where(decoder) * audio_format.sample_rate; - afSeekFrame(af_fp, AF_DEFAULT_TRACK, current); + afSeekFrame(af_fp, AF_DEFAULT_TRACK, frame); decoder_command_finished(decoder); cmd = DECODE_COMMAND_NONE; -- cgit v1.2.3