decoder/pcm: check InputStream::KnownSize()
This commit is contained in:
parent
a862e363ea
commit
194be51f05
@ -43,9 +43,8 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
|
|||||||
const double time_to_size = audio_format.GetTimeToSize();
|
const double time_to_size = audio_format.GetTimeToSize();
|
||||||
|
|
||||||
float total_time = -1;
|
float total_time = -1;
|
||||||
const auto size = is.GetSize();
|
if (is.KnownSize())
|
||||||
if (size >= 0)
|
total_time = is.GetSize() / time_to_size;
|
||||||
total_time = size / time_to_size;
|
|
||||||
|
|
||||||
decoder_initialized(decoder, audio_format,
|
decoder_initialized(decoder, audio_format,
|
||||||
is.IsSeekable(), total_time);
|
is.IsSeekable(), total_time);
|
||||||
|
Loading…
Reference in New Issue
Block a user