diff options
author | Max Kellermann <max@duempel.org> | 2009-11-11 20:18:39 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-11 20:18:39 +0100 |
commit | e0d5ee00451630c83ba1693939aa6c923f41b727 (patch) | |
tree | 9f9b6ebe6f492d54ee352384b12c62988b56e8d0 /src/decoder/_flac_common.h | |
parent | d35efddd65934e5adebe0c01ab7953c9a34082ed (diff) | |
download | mpd-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/_flac_common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/decoder/_flac_common.h b/src/decoder/_flac_common.h index aa17c55ae..84b66285f 100644 --- a/src/decoder/_flac_common.h +++ b/src/decoder/_flac_common.h @@ -52,11 +52,16 @@ struct flac_data { FLAC__StreamMetadata_StreamInfo stream_info; /** + * The number of the first frame in this song. This is only + * non-zero if playing sub songs from a CUE sheet. + */ + FLAC__uint64 first_frame; + + /** * The number of the next frame which is going to be decoded. */ FLAC__uint64 next_frame; - float time; struct audio_format audio_format; FLAC__uint64 position; struct decoder *decoder; |