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/sidplay_plugin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/decoder/sidplay_plugin.cxx') diff --git a/src/decoder/sidplay_plugin.cxx b/src/decoder/sidplay_plugin.cxx index 63e46a285..9bfe98f3d 100644 --- a/src/decoder/sidplay_plugin.cxx +++ b/src/decoder/sidplay_plugin.cxx @@ -284,7 +284,6 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs) /* .. and play */ - unsigned data_time = 0; const unsigned timebase = player.timebase(); song_len *= timebase; @@ -297,12 +296,13 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs) if (nbytes == 0) break; + decoder_timestamp(decoder, (double)player.time() / timebase); + cmd = decoder_data(decoder, NULL, buffer, nbytes, - (float)data_time / (float)timebase, 0, NULL); - data_time = player.time(); if(cmd==DECODE_COMMAND_SEEK) { + unsigned data_time = player.time(); unsigned target_time = (unsigned) (decoder_seek_where(decoder) * timebase); @@ -323,7 +323,7 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs) decoder_command_finished(decoder); } - if (song_len > 0 && data_time >= song_len) + if (song_len > 0 && player.time() >= song_len) break; } while (cmd != DECODE_COMMAND_STOP); -- cgit v1.2.3