[Python-modules-commits] r7453 - in packages/mutagen/branches/maint-1.4/debian (2 files)

mithrandi-guest at users.alioth.debian.org mithrandi-guest at users.alioth.debian.org
Fri Feb 6 07:49:30 UTC 2009


    Date: Friday, February 6, 2009 @ 07:49:30
  Author: mithrandi-guest
Revision: 7453

Trim irrelevant part of patch.

Modified:
  packages/mutagen/branches/maint-1.4/debian/changelog
  packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch

Modified: packages/mutagen/branches/maint-1.4/debian/changelog
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/changelog	2009-02-06 07:43:37 UTC (rev 7452)
+++ packages/mutagen/branches/maint-1.4/debian/changelog	2009-02-06 07:49:30 UTC (rev 7453)
@@ -1,7 +1,7 @@
 mutagen (1.14-2) unstable; urgency=high
 
   * Setting urgency to high for grave dataloss bugfix.
-  * Backport r4339 from upstream (closes: #514118).
+  * Backport part of r4339 from upstream (closes: #514118).
     - This patch fixes a data loss issue when handling FLAC files with more
       than two channels.
 

Modified: packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch	2009-02-06 07:43:37 UTC (rev 7452)
+++ packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch	2009-02-06 07:49:30 UTC (rev 7453)
@@ -1,31 +1,4 @@
 # Fix handling of FLAC files with more than two channels.
---- a/mutagen/mp3.py
-+++ b/mutagen/mp3.py
-@@ -184,7 +184,8 @@
-                 self.sketchy = False
-                 vbri_version = struct.unpack('>H', data[vbri + 4:vbri + 6])[0]
-                 if vbri_version == 1:
--                    frame_count = struct.unpack('>I', data[vbri + 14:vbri + 18])[0]
-+                    frame_count = struct.unpack(
-+                        '>I', data[vbri + 14:vbri + 18])[0]
-                     samples = frame_size * frame_count
-                     self.length = (samples / self.sample_rate) or self.length
-         else:
-@@ -199,6 +200,14 @@
-                 bytes = struct.unpack('>I', data[xing + 12:xing + 16])[0]
-                 self.bitrate = int((bytes * 8) // self.length)
- 
-+        # If the bitrate * the length is nowhere near the file
-+        # length, recalculate using the bitrate and file length.
-+        fileobj.seek(2, 0)
-+        size = fileobj.tell()
-+        expected = (self.bitrate / 8) * self.length
-+        if not (size / 2 < expected < size * 2):
-+            self.length = size / float(self.bitrate * 8)
-+
-     def pprint(self):
-         s = "MPEG %s layer %d, %d bps, %s Hz, %.2f seconds" % (
-             self.version, self.layer, self.bitrate, self.sample_rate,
 --- a/mutagen/flac.py
 +++ b/mutagen/flac.py
 @@ -153,7 +153,7 @@




More information about the Python-modules-commits mailing list