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

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


    Date: Friday, February 6, 2009 @ 07:43:37
  Author: mithrandi-guest
Revision: 7452

Fix it!

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

Modified: packages/mutagen/branches/maint-1.4/debian/changelog
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/changelog	2009-02-06 07:23:14 UTC (rev 7451)
+++ packages/mutagen/branches/maint-1.4/debian/changelog	2009-02-06 07:43:37 UTC (rev 7452)
@@ -1,3 +1,12 @@
+mutagen (1.14-2) unstable; urgency=high
+
+  * Setting urgency to high for grave dataloss bugfix.
+  * Backport r4339 from upstream (closes: #514118).
+    - This patch fixes a data loss issue when handling FLAC files with more
+      than two channels.
+
+ -- Tristan Seligmann <mithrandi at mithrandi.net>  Fri, 06 Feb 2009 09:42:42 +0200
+
 mutagen (1.14-1) unstable; urgency=low
 
   * New upstream release.

Modified: packages/mutagen/branches/maint-1.4/debian/control
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/control	2009-02-06 07:23:14 UTC (rev 7451)
+++ packages/mutagen/branches/maint-1.4/debian/control	2009-02-06 07:43:37 UTC (rev 7452)
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Tristan Seligmann <mithrandi at mithrandi.net>
 Build-Depends-Indep: python-central (>= 0.5)
-Build-Depends: cdbs (>= 0.4.42), debhelper (>= 6), python (>= 2.3.5-7)
+Build-Depends: cdbs (>= 0.4.42), debhelper (>= 6), python (>= 2.3.5-7), quilt
 Standards-Version: 3.7.3
 XS-Python-Version: >= 2.3
 Vcs-Darcs: http://slipgate.za.net/~mithrandi/darcs/debian/mutagen/mutagen

Added: packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch	                        (rev 0)
+++ packages/mutagen/branches/maint-1.4/debian/patches/flac-handling-fix.patch	2009-02-06 07:43:37 UTC (rev 7452)
@@ -0,0 +1,63 @@
+# 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 @@
+         f.write(struct.pack(">I", self.sample_rate >> 4)[-2:])
+         # 4 bits sample, 3 channel, 1 bps
+         byte = (self.sample_rate & 0xF) << 4
+-        byte += ((self.channels - 1) & 3) << 1
++        byte += ((self.channels - 1) & 7) << 1
+         byte += ((self.bits_per_sample - 1) >> 4) & 1
+         f.write(chr(byte))
+         # 4 bits of bps, 4 of sample count
+--- a/tests/test_flac.py
++++ b/tests/test_flac.py
+@@ -62,9 +62,9 @@
+ class TStreamInfo(TestCase):
+     uses_mmap = False
+ 
+-    data = ("\x12\x00\x12\x00\x00\x00\x0e\x00\x35\xea\x0a\xc4\x42\xf0"
+-            "\x00\xca\x30\x14\x28\x90\xf9\xe1\x29\x32\x13\x01\xd4\xa7"
+-            "\xa9\x11\x21\x38\xab\x91")
++    data = ('\x12\x00\x12\x00\x00\x00\x0e\x005\xea\n\xc4H\xf0\x00\xca0'
++            '\x14(\x90\xf9\xe1)2\x13\x01\xd4\xa7\xa9\x11!8\xab\x91')
++
+     def setUp(self):
+         self.i = StreamInfo(self.data)
+ 
+@@ -77,7 +77,7 @@
+         self.failUnlessEqual(self.i.max_framesize, 13802)
+         self.failUnless(self.i.min_framesize <= self.i.max_framesize)
+     def test_sample_rate(self): self.failUnlessEqual(self.i.sample_rate, 44100)
+-    def test_channels(self): self.failUnlessEqual(self.i.channels, 2)
++    def test_channels(self): self.failUnlessEqual(self.i.channels, 5)
+     def test_bps(self): self.failUnlessEqual(self.i.bits_per_sample, 16)
+     def test_length(self): self.failUnlessAlmostEqual(self.i.length, 300.5, 1)
+     def test_total_samples(self):

Added: packages/mutagen/branches/maint-1.4/debian/patches/series
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/patches/series	                        (rev 0)
+++ packages/mutagen/branches/maint-1.4/debian/patches/series	2009-02-06 07:43:37 UTC (rev 7452)
@@ -0,0 +1 @@
+flac-handling-fix.patch 

Modified: packages/mutagen/branches/maint-1.4/debian/rules
===================================================================
--- packages/mutagen/branches/maint-1.4/debian/rules	2009-02-06 07:23:14 UTC (rev 7451)
+++ packages/mutagen/branches/maint-1.4/debian/rules	2009-02-06 07:43:37 UTC (rev 7452)
@@ -3,6 +3,7 @@
 DEB_PYTHON_SYSTEM = pycentral
 
 include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 
 DEB_INSTALL_CHANGELOGS_ALL = NEWS




More information about the Python-modules-commits mailing list