diff options
author | Max Kellermann <max@duempel.org> | 2009-12-25 19:47:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-26 03:01:43 +0100 |
commit | bad350bc18ab81661253bf42245b9e3fa175d026 (patch) | |
tree | 47a1dd5d4b81520eb9ae1ce407d2fea84d71736f /src/decoder/modplug_plugin.c | |
parent | 870436a592b081c4630b9ecc36ff8daecf6496cc (diff) | |
download | mpd-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 '')
-rw-r--r-- | src/decoder/modplug_plugin.c | 6 |
1 files changed, 0 insertions, 6 deletions
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); } |