aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/PcmDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-19 20:57:00 +0200
committerMax Kellermann <max@duempel.org>2014-08-19 20:57:00 +0200
commit194be51f05c991a69032388831c21b7595e3d544 (patch)
tree6f6c7247b7c03dab92fabd51d0bff7aafaefef42 /src/decoder/plugins/PcmDecoderPlugin.cxx
parenta862e363ead63f39d60061096d3d050bc81aa6e2 (diff)
downloadmpd-194be51f05c991a69032388831c21b7595e3d544.tar.gz
mpd-194be51f05c991a69032388831c21b7595e3d544.tar.xz
mpd-194be51f05c991a69032388831c21b7595e3d544.zip
decoder/pcm: check InputStream::KnownSize()
Diffstat (limited to '')
-rw-r--r--src/decoder/plugins/PcmDecoderPlugin.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/decoder/plugins/PcmDecoderPlugin.cxx b/src/decoder/plugins/PcmDecoderPlugin.cxx
index 3b9c60691..da8287464 100644
--- a/src/decoder/plugins/PcmDecoderPlugin.cxx
+++ b/src/decoder/plugins/PcmDecoderPlugin.cxx
@@ -43,9 +43,8 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
const double time_to_size = audio_format.GetTimeToSize();
float total_time = -1;
- const auto size = is.GetSize();
- if (size >= 0)
- total_time = size / time_to_size;
+ if (is.KnownSize())
+ total_time = is.GetSize() / time_to_size;
decoder_initialized(decoder, audio_format,
is.IsSeekable(), total_time);