summaryrefslogtreecommitdiff
path: root/debian/patches/33_flac_mutagen.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/33_flac_mutagen.patch')
-rw-r--r--debian/patches/33_flac_mutagen.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/patches/33_flac_mutagen.patch b/debian/patches/33_flac_mutagen.patch
new file mode 100644
index 0000000..58897d1
--- /dev/null
+++ b/debian/patches/33_flac_mutagen.patch
@@ -0,0 +1,69 @@
+From: Joe Wreschnig <piman@sacredchao.net>
+
+Attached is a patch to jack_init.py and jack_tag.py to make them use
+Mutagen rather than pyflac. Mutagen exposes the stream info as
+f.info.{sample_rate,total_samples}, similar to pyflac. [pyflac is no longer
+maintained]
+
+
+diff -urN jack-3.1.1+cvs20050801~/jack_init.py jack-3.1.1+cvs20050801/jack_init.py
+--- jack-3.1.1+cvs20050801~/jack_init.py 2006-02-05 15:09:07.000000000 +0100
++++ jack-3.1.1+cvs20050801/jack_init.py 2006-04-04 22:49:42.000000000 +0200
+@@ -62,7 +62,7 @@
+ ogg = dummy_ogg()
+
+ try:
+- import flac.metadata
++ import mutagen.flac as flac
+ except ImportError:
+ flac = None
+
+diff -urN jack-3.1.1+cvs20050801~/jack_tag.py jack-3.1.1+cvs20050801/jack_tag.py
+--- jack-3.1.1+cvs20050801~/jack_tag.py 2006-04-04 22:59:44.000000000 +0200
++++ jack-3.1.1+cvs20050801/jack_tag.py 2006-04-04 22:59:10.000000000 +0200
+@@ -153,31 +153,21 @@
+ mp3file.close()
+ elif jack_helpers.helpers[cf['_encoder']]['target'] == "flac":
+ if flac:
+- chain = flac.metadata.Chain()
+- chain.read(mp3name)
+- it = flac.metadata.Iterator()
+- it.init(chain)
+- while 1:
+- if it.get_block_type() == flac.metadata.VORBIS_COMMENT:
+- block = it.get_block()
+- vc = flac.metadata.VorbisComment(block)
+- break
+- if not it.next():
+- break
+- if vc:
+- vc.comments['ALBUM'] = a_title.encode("utf-8")
+- vc.comments['TRACKNUMBER'] = `i[NUM]`
+- vc.comments['TITLE'] = t_name.encode("utf-8")
+- vc.comments['ARTIST'] = t_artist.encode("utf-8")
+- if cf['_id3_genre'] != -1:
+- vc.comments['GENRE'] = id3genres[cf['_id3_genre']]
+- if cf['_id3_year'] != -1:
+- vc.comments['DATE'] = `cf['_id3_year']`
+- chain.write(True, True)
++ f = flac.FLAC(mp3name)
++ if f.vc is None: f.add_vorbiscomment()
++ f.vc['ALBUM'] = a_title
++ f.vc['TRACKNUMBER'] = str(i[NUM])
++ f.vc['TITLE'] = t_name
++ f.vc['ARTIST'] = t_artist
++ if cf['_id3_genre'] != -1:
++ f.vc['GENRE'] = id3genres[cf['_id3_genre']]
++ if cf['_id3_year'] != -1:
++ f.vc['DATE'] = str(cf['_id3_year'])
++ f.save()
+ else:
+ print
+- print "Please install the pyflac module available at"
+- print "http://www.sacredchao.net/quodlibet/wiki/Download"
++ print "Please install the Mutagen module available at"
++ print "http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen"
+ print "Without it, you'll not be able to tag FLAC tracks."
+ elif jack_helpers.helpers[cf['_encoder']]['target'] == "ogg":
+ vf = ogg.vorbis.VorbisFile(mp3name)
+