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/faad_plugin.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/decoder/faad_plugin.c') diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c index c91f8e8f6..2272963b9 100644 --- a/src/decoder/faad_plugin.c +++ b/src/decoder/faad_plugin.c @@ -383,7 +383,6 @@ static void faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) { GError *error = NULL; - float file_time; float total_time = 0; faacDecHandle decoder; struct audio_format audio_format; @@ -434,8 +433,6 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) /* the decoder loop */ - file_time = 0.0; - do { size_t frame_size; const void *decoded; @@ -481,15 +478,12 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is) bit_rate = frame_info.bytesconsumed * 8.0 * frame_info.channels * audio_format.sample_rate / frame_info.samples / 1000 + 0.5; - file_time += - (float)(frame_info.samples) / frame_info.channels / - audio_format.sample_rate; } /* send PCM samples to MPD */ cmd = decoder_data(mpd_decoder, is, decoded, - (size_t)frame_info.samples * 2, file_time, + (size_t)frame_info.samples * 2, bit_rate, NULL); } while (cmd != DECODE_COMMAND_STOP); -- cgit v1.2.3