Skip to content

Commit

Permalink
Merge branch 'master' of github.com:devsnd/tinytag
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnd committed Apr 29, 2017
2 parents 1f92097 + fe5c720 commit 1c1a529
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -34,3 +34,6 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

# Jetbrains
.idea/
2 changes: 1 addition & 1 deletion tinytag/tinytag.py
Expand Up @@ -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()
Expand Down

0 comments on commit 1c1a529

Please sign in to comment.