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/modplug_plugin.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/decoder/modplug_plugin.c') diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c index df4a99f7f..05c9ef2d7 100644 --- a/src/decoder/modplug_plugin.c +++ b/src/decoder/modplug_plugin.c @@ -96,7 +96,6 @@ mod_decode(struct decoder *decoder, struct input_stream *is) struct audio_format audio_format; int ret; char audio_buffer[MODPLUG_FRAME_SIZE]; - unsigned frame_size, current_frame = 0; enum decoder_command cmd = DECODE_COMMAND_NONE; bdatas = mod_loadfile(decoder, is); @@ -128,24 +127,19 @@ mod_decode(struct decoder *decoder, struct input_stream *is) decoder_initialized(decoder, &audio_format, is->seekable, ModPlug_GetLength(f) / 1000.0); - frame_size = audio_format_frame_size(&audio_format); - do { ret = ModPlug_Read(f, audio_buffer, MODPLUG_FRAME_SIZE); if (ret <= 0) break; - current_frame += (unsigned)ret / frame_size; cmd = decoder_data(decoder, NULL, audio_buffer, ret, - (float)current_frame / (float)audio_format.sample_rate, 0, NULL); if (cmd == DECODE_COMMAND_SEEK) { float where = decoder_seek_where(decoder); ModPlug_Seek(f, (int)(where * 1000.0)); - current_frame = (unsigned)(where * audio_format.sample_rate); decoder_command_finished(decoder); } -- cgit v1.2.3