Skip to content

Commit

Permalink
Fix MP4 Chapter timestamp parsing
Browse files Browse the repository at this point in the history
This should fix issue quodlibet#639 and get rid of other similar issues.
  • Loading branch information
davidgfnet committed Jan 31, 2024
1 parent f95d3ae commit 06329e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mutagen/mp4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def _parse_chpl(self, atom, fileobj):

pos = 9
for i in range(chapters):
start = struct.unpack(">Q", data[pos:pos + 8])[0] / 10000
start = struct.unpack(">Q", data[pos:pos + 8])[0] / 10000000
pos += 8

title_len = data[pos]
Expand All @@ -1003,7 +1003,7 @@ def _parse_chpl(self, atom, fileobj):
raise MP4MetadataError("chapter %d title: %s" % (i, e))
pos += title_len

self._chapters.append(Chapter(start / self._timescale, title))
self._chapters.append(Chapter(start, title))

def pprint(self):
chapters = ["%s %s" % (timedelta(seconds=chapter.start), chapter.title)
Expand Down

0 comments on commit 06329e0

Please sign in to comment.