decoder/mad: check InputStream::KnownSize()
This commit is contained in:
parent
4da3291157
commit
51cda0be2a
@ -769,9 +769,9 @@ MadDecoder::RestIncludingThisFrame() const
|
|||||||
inline void
|
inline void
|
||||||
MadDecoder::FileSizeToSongLength()
|
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);
|
float frame_duration = mp3_frame_duration(&frame);
|
||||||
|
|
||||||
total_time = (rest * 8.0) / frame.header.bitrate;
|
total_time = (rest * 8.0) / frame.header.bitrate;
|
||||||
|
Loading…
Reference in New Issue
Block a user