Fix codec reference in MediaFile (fix #1117)

This commit is contained in:
Adrian Sampson 2014-11-26 19:04:40 -08:00
parent 42228e6d82
commit 903e88a228
2 changed files with 9 additions and 2 deletions

View file

@ -1340,8 +1340,9 @@ class MediaFile(object):
raise FileTypeError(path)
elif (type(self.mgfile).__name__ == 'M4A' or
type(self.mgfile).__name__ == 'MP4'):
if hasattr(self.mgfile.info, 'codec'):
if self.mgfile.codec and self.mgfile.codec.startswith('alac'):
info = self.mgfile.info
if hasattr(info, 'codec'):
if info.codec and info.codec.startswith('alac'):
self.type = 'alac'
else:
self.type = 'aac'

View file

@ -4,9 +4,15 @@ Changelog
1.3.10 (in development)
-----------------------
New:
* A new :doc:`/plugins/permissions` makes it easy to fix permissions on music
files as they are imported. Thanks to :user:`xsteadfastx`. :bug:`1098`
Fixed:
* Fix a new crash with the latest version of Mutagen (1.26).
1.3.9 (November 17, 2014)
-------------------------