diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-09-02 14:09:07 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-09-02 14:09:07 +0100 |
commit | b17a3ef12038de50228bade1f05502c74e135321 (patch) | |
tree | 9026dffec53f92cba48ca9a500a4f778e6304380 /media-sound/edna/files/edna-0.6-flac.patch | |
parent | 3cf7c3ef441822c889356fd1812ebf2944a59851 (diff) |
gentoo resync : 02.09.2020
Diffstat (limited to 'media-sound/edna/files/edna-0.6-flac.patch')
-rw-r--r-- | media-sound/edna/files/edna-0.6-flac.patch | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/media-sound/edna/files/edna-0.6-flac.patch b/media-sound/edna/files/edna-0.6-flac.patch deleted file mode 100644 index b22687d2fb05..000000000000 --- a/media-sound/edna/files/edna-0.6-flac.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- edna.py.orig 2007-01-31 19:25:14.000000000 +0000 -+++ edna.py 2007-01-31 20:55:09.000000000 +0000 -@@ -64,6 +64,12 @@ - oggSupport = 'no' - - try: -+ from mutagen.flac import FLAC -+ flacSupport = True -+except ImportError: -+ flacSupport = False -+ -+try: - import cStringIO - StringIO = cStringIO - except ImportError: -@@ -920,6 +926,9 @@ - if ext == '.ogg': - info = OggInfo(fullpath) - self.__dict__.update(info.__dict__) -+ elif ext == '.flac': -+ info = FlacInfo(fullpath) -+ self.__dict__.update(info.__dict__) - else: - info = MP3Info.MP3Info(open(fullpath, 'rb')) - self.__dict__.update(info.__dict__) -@@ -1001,6 +1010,45 @@ - self.transcoded = val - self.valid = 1 - -+class FlacInfo: -+ def __init__(self, name): -+ # Setup the defaults -+ self.valid = 0 -+ self.total_time = 0 -+ self.samplerate = 'unknown' -+ self.bitrate = 'unknown' -+ self.mode = '' -+ self.mode_extension = '' -+ -+ if not flacSupport: return -+ -+ mflac = FLAC(name) -+ streaminfo = mflac.metadata_blocks[0] -+ -+ self.samplerate = streaminfo.sample_rate -+ self.total_time = streaminfo.length -+ self.bitrate =int(round((streaminfo.bits_per_sample * streaminfo.total_samples) / streaminfo.length)) -+ self.filesize = os.path.getsize(name) / (1024 ** 2) -+ -+ for key, val in mflac.tags: -+ if key == 'TITLE': -+ self.title = val -+ elif key == 'ARTIST': -+ self.artist = val -+ elif key == 'ALBUM': -+ self.album = val -+ elif key == 'DATE': -+ self.year = val -+ elif key == 'GENRE': -+ self.genre = val -+ elif key == 'VENDOR': -+ self.vendor = val -+ elif key == 'TRACKNUMBER': -+ self.track = val -+ elif key == 'DESCRIPTION': -+ self.comment = val -+ -+ self.valid = 1 - - def _usable_file(fname): - return fname[0] != '.' -@@ -1044,6 +1092,7 @@ - '.avi' : 'video/x-msvideo', - '.mpg' : 'video/mpeg', - '.ogg' : 'application/x-ogg', -+ '.flac' : 'audio/x-flac', - '.m4a' : 'audio/mp4', - '.mp4' : 'video/mp4', - } |