DecoderControl: use SignedSongTime for the song duration

This commit is contained in:
Max Kellermann
2014-08-29 12:44:54 +02:00
parent 7c25d83f1c
commit ca252804c6
3 changed files with 6 additions and 4 deletions

View File

@@ -59,7 +59,9 @@ decoder_initialized(Decoder &decoder,
dc.out_audio_format = getOutputAudioFormat(audio_format);
dc.seekable = seekable;
dc.total_time = total_time;
dc.total_time = total_time > 0
? SignedSongTime::FromS(total_time)
: SignedSongTime::Negative();
FormatDebug(decoder_domain, "audio_format=%s, seekable=%s",
audio_format_to_string(dc.in_audio_format, &af_string),

View File

@@ -142,7 +142,7 @@ struct DecoderControl {
*/
SongTime end_time;
float total_time;
SignedSongTime total_time;
/** the #MusicChunk allocator */
MusicBuffer *buffer;