aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/oggflac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-11 20:18:39 +0100
committerMax Kellermann <max@duempel.org>2009-11-11 20:18:39 +0100
commite0d5ee00451630c83ba1693939aa6c923f41b727 (patch)
tree9f9b6ebe6f492d54ee352384b12c62988b56e8d0 /src/decoder/oggflac_plugin.c
parentd35efddd65934e5adebe0c01ab7953c9a34082ed (diff)
downloadmpd-e0d5ee00451630c83ba1693939aa6c923f41b727.tar.gz
mpd-e0d5ee00451630c83ba1693939aa6c923f41b727.tar.xz
mpd-e0d5ee00451630c83ba1693939aa6c923f41b727.zip
decoder/flac: calculate time stamp from current frame
Don't update a float timestamp, this will make imprecisions add up after a while. We already have the number of the current frame, let's just calculate the float timestamp from that for every decoder_data() command. For this, we need to add the attribute "first_frame", for CUE sheet songs.
Diffstat (limited to '')
-rw-r--r--src/decoder/oggflac_plugin.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c
index d9a5b9226..e47cacd49 100644
--- a/src/decoder/oggflac_plugin.c
+++ b/src/decoder/oggflac_plugin.c
@@ -155,11 +155,6 @@ oggflac_write_cb(G_GNUC_UNUSED const OggFLAC__SeekableStreamDecoder *decoder,
void *vdata)
{
struct flac_data *data = (struct flac_data *) vdata;
- FLAC__uint32 samples = frame->header.blocksize;
- float time_change;
-
- time_change = ((float)samples) / frame->header.sample_rate;
- data->time += time_change;
return flac_common_write(data, frame, buf, 0);
}
@@ -338,8 +333,6 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
if (OggFLAC__seekable_stream_decoder_seek_absolute
(decoder, seek_sample)) {
data.next_frame = seek_sample;
- data.time = ((float)seek_sample) /
- data.audio_format.sample_rate;
data.position = 0;
decoder_command_finished(mpd_decoder);
} else