Commit 51cda0be authored by Max Kellermann's avatar Max Kellermann

decoder/mad: check InputStream::KnownSize()

parent 4da32911
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment