diff --git a/.gitignore b/.gitignore index ded6067..a11e961 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ nosetests.xml .mr.developer.cfg .project .pydevproject + +# Jetbrains +.idea/ \ No newline at end of file diff --git a/tinytag/tinytag.py b/tinytag/tinytag.py index 7227f4f..b689063 100644 --- a/tinytag/tinytag.py +++ b/tinytag/tinytag.py @@ -516,7 +516,7 @@ def _determine_duration(self, fh): if xing_header_offset != -1: fh.seek(xing_header_offset, os.SEEK_CUR) xframes, byte_count, toc, vbr_scale = self._parse_xing_header(fh) - if xframes is not None and byte_count is not None: + if xframes and xframes != 0 and byte_count: self.duration = xframes * ID3.samples_per_frame / float(self.samplerate) self.bitrate = byte_count * 8 / self.duration / 1000 self.audio_offset = fh.tell()