aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/sidplay_plugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-25 19:47:33 +0100
committerMax Kellermann <max@duempel.org>2009-12-26 03:01:43 +0100
commitbad350bc18ab81661253bf42245b9e3fa175d026 (patch)
tree47a1dd5d4b81520eb9ae1ce407d2fea84d71736f /src/decoder/sidplay_plugin.cxx
parent870436a592b081c4630b9ecc36ff8daecf6496cc (diff)
downloadmpd-bad350bc18ab81661253bf42245b9e3fa175d026.tar.gz
mpd-bad350bc18ab81661253bf42245b9e3fa175d026.tar.xz
mpd-bad350bc18ab81661253bf42245b9e3fa175d026.zip
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.
Diffstat (limited to 'src/decoder/sidplay_plugin.cxx')
-rw-r--r--src/decoder/sidplay_plugin.cxx8
1 files changed, 4 insertions, 4 deletions
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);