aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-19 20:32:48 +0200
committerMax Kellermann <max@duempel.org>2014-08-19 20:44:29 +0200
commit51cda0be2a82a4557b7c5944f268edc28745fae8 (patch)
treedb5515b627d48d745955e2d2ad1a55dbbb9580e6
parent4da3291157ce38b0baa41c16782be94da6ec2b0a (diff)
downloadmpd-51cda0be2a82a4557b7c5944f268edc28745fae8.tar.gz
mpd-51cda0be2a82a4557b7c5944f268edc28745fae8.tar.xz
mpd-51cda0be2a82a4557b7c5944f268edc28745fae8.zip
decoder/mad: check InputStream::KnownSize()
-rw-r--r--src/decoder/plugins/MadDecoderPlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx
index 886aa1795..e38fe3f29 100644
--- a/src/decoder/plugins/MadDecoderPlugin.cxx
+++ b/src/decoder/plugins/MadDecoderPlugin.cxx
@@ -769,9 +769,9 @@ MadDecoder::RestIncludingThisFrame() const
inline void
MadDecoder::FileSizeToSongLength()
{
- InputStream::offset_type rest = RestIncludingThisFrame();
+ if (input_stream.KnownSize()) {
+ InputStream::offset_type rest = RestIncludingThisFrame();
- if (rest > 0) {
float frame_duration = mp3_frame_duration(&frame);
total_time = (rest * 8.0) / frame.header.bitrate;