DecoderControl: use SignedSongTime for the song duration
This commit is contained in:
parent
7c25d83f1c
commit
ca252804c6
@ -450,7 +450,7 @@ Player::CheckDecoderStartup()
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
pc.Lock();
|
pc.Lock();
|
||||||
pc.total_time = real_song_duration(*dc.song, dc.total_time);
|
pc.total_time = real_song_duration(*dc.song, dc.total_time.ToDoubleS());
|
||||||
pc.audio_format = dc.in_audio_format;
|
pc.audio_format = dc.in_audio_format;
|
||||||
pc.Unlock();
|
pc.Unlock();
|
||||||
|
|
||||||
@ -1001,7 +1001,7 @@ Player::Run()
|
|||||||
calculate how many chunks will be required
|
calculate how many chunks will be required
|
||||||
for it */
|
for it */
|
||||||
cross_fade_chunks =
|
cross_fade_chunks =
|
||||||
pc.cross_fade.Calculate(dc.total_time,
|
pc.cross_fade.Calculate(dc.total_time.ToDoubleS(),
|
||||||
dc.replay_gain_db,
|
dc.replay_gain_db,
|
||||||
dc.replay_gain_prev_db,
|
dc.replay_gain_prev_db,
|
||||||
dc.GetMixRampStart(),
|
dc.GetMixRampStart(),
|
||||||
|
@ -59,7 +59,9 @@ decoder_initialized(Decoder &decoder,
|
|||||||
dc.out_audio_format = getOutputAudioFormat(audio_format);
|
dc.out_audio_format = getOutputAudioFormat(audio_format);
|
||||||
|
|
||||||
dc.seekable = seekable;
|
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",
|
FormatDebug(decoder_domain, "audio_format=%s, seekable=%s",
|
||||||
audio_format_to_string(dc.in_audio_format, &af_string),
|
audio_format_to_string(dc.in_audio_format, &af_string),
|
||||||
|
@ -142,7 +142,7 @@ struct DecoderControl {
|
|||||||
*/
|
*/
|
||||||
SongTime end_time;
|
SongTime end_time;
|
||||||
|
|
||||||
float total_time;
|
SignedSongTime total_time;
|
||||||
|
|
||||||
/** the #MusicChunk allocator */
|
/** the #MusicChunk allocator */
|
||||||
MusicBuffer *buffer;
|
MusicBuffer *buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user