aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-11 15:09:24 +0100
committerMax Kellermann <max@duempel.org>2009-11-11 15:31:17 +0100
commit80b220a3a68b4f9c4d21fa416ff220e4262cde82 (patch)
tree060fa951317fb59154a8d2dde442ec41b5168be3 /src/decoder/flac_plugin.c
parent5cc3c4f5039cc57b414de3b94bb3ab0e54f28556 (diff)
downloadmpd-80b220a3a68b4f9c4d21fa416ff220e4262cde82.tar.gz
mpd-80b220a3a68b4f9c4d21fa416ff220e4262cde82.tar.xz
mpd-80b220a3a68b4f9c4d21fa416ff220e4262cde82.zip
decoder/flac: keep track of current frame number
We need this for more exact end-of-subsong detection for CUE files.
Diffstat (limited to 'src/decoder/flac_plugin.c')
-rw-r--r--src/decoder/flac_plugin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 17d0e8519..f7b8cdb96 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -460,6 +460,7 @@ flac_decode_internal(struct decoder * decoder,
FLAC__uint64 seek_sample = decoder_seek_where(decoder) *
data.audio_format.sample_rate + 0.5;
if (flac_seek_absolute(flac_dec, seek_sample)) {
+ data.next_frame = seek_sample;
data.time = ((float)seek_sample) /
data.audio_format.sample_rate;
data.position = 0;
@@ -634,6 +635,7 @@ flac_container_decode(struct decoder* decoder,
if (seek_sample >= t_start && seek_sample <= t_end &&
flac_seek_absolute(flac_dec, (FLAC__uint64)seek_sample)) {
+ data.next_frame = seek_sample;
data.time = (float)(seek_sample - t_start) /
data.audio_format.sample_rate;
data.position = 0;
@@ -756,6 +758,7 @@ flac_filedecode_internal(struct decoder* decoder,
data.audio_format.sample_rate + 0.5;
if (flac_seek_absolute(flac_dec, seek_sample))
{
+ data.next_frame = seek_sample;
data.time = ((float)seek_sample) /
data.audio_format.sample_rate;
data.position = 0;