From 06329e00d9e9ea81e810f3b4c129890a5087a8fb Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Wed, 31 Jan 2024 01:08:07 +0100 Subject: [PATCH] Fix MP4 Chapter timestamp parsing This should fix issue #639 and get rid of other similar issues. --- mutagen/mp4/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutagen/mp4/__init__.py b/mutagen/mp4/__init__.py index 9e1757ec..1d905a64 100644 --- a/mutagen/mp4/__init__.py +++ b/mutagen/mp4/__init__.py @@ -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] @@ -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)