leosongwei / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

m4a files edited from iTunes are not readable #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
mutagen-inpsect does not seem to be able to read m4a files that were edited 
from iTunes.

All of my tracks with unedited tags are read fine. However, any file a field 
was changed in (Such as genre, year, title, etc) are unable to be read by 
mutagen.

On windows (iTunes not installed, no iTunes DB) Winamp,foobar2000, and of 
course iTunes can read them correctly.

Output:

[sundial@sundial-desktop Endless Wave]$ mutagen-inspect 01\ Endless\ Wave.m4a 
-- 01 Endless Wave.m4a
- MPEG-4 audio, 364.18 seconds, 256000 bps (audio/mp4)

I can provide example files if needed. Thanks!

Original issue reported on code.google.com by vanc...@gmail.com on 9 Sep 2010 at 2:43

GoogleCodeExporter commented 9 years ago
BTW, the version I have installed is: mutagen 1.20-1

Original comment by vanc...@gmail.com on 9 Sep 2010 at 2:23

GoogleCodeExporter commented 9 years ago
I hacked around it, not a permanent solution. Problem was, all the tags were 
read correctly, when it got to the very end and looked for "data" it found 
something else.

Basically at mp4.py:663 I changed 
            try: self.tags = self.MP4Tags(atoms, fileobj)
            except MP4MetadataError:
                self.tags = None

to:
            self.tags = self.MP4Tags(atoms, fileobj)
            #try: self.tags = self.MP4Tags(atoms, fileobj)
            #except MP4MetadataError:
                #self.tags = None

And all of my m4a files load just fine!

Yes, this is an ugly hack, however mutagen needs to return what valid 
information it did find, rather than just return nothing.

Original comment by vanc...@gmail.com on 18 Sep 2010 at 3:57

GoogleCodeExporter commented 9 years ago
What did it find rather than "data"?

Are you sure you didn't change anything else? That doesn't look like it should 
have made the files readable. Also, be careful - without the "data" flag we 
will have trouble re-writing the audio data correctly into the file, so saving 
new tags may corrupt your files.

Original comment by joe.wreschnig@gmail.com on 18 Sep 2010 at 8:45

GoogleCodeExporter commented 9 years ago
For one of the files, it says, for atmom NITR found "NTKB" instead of data.

I swear, thats the only thing I changed, and my entire m4a library loaded ok 
into exaile, and mutagen-inspect started working.

Also, I Tested writing some of the files with picard and it had NO problems. 
(When I am doing all this testing, my music has been backed up in 2 locations 
already)

Original comment by vanc...@gmail.com on 18 Sep 2010 at 3:46

GoogleCodeExporter commented 9 years ago
I think I need to see an example file to debug this properly.

Original comment by joe.wreschnig@gmail.com on 27 Oct 2010 at 11:41

GoogleCodeExporter commented 9 years ago
While I would definitely believe that iTunes changes something in the file so 
Mutagen can't read it, I don't see how the proposed change would make it 
readable. Simply not catching the exception is going to cause it to propagate 
higher and make the entire file unreadable, not just the tags.

If someone can provide a sample file, I will reopen this.

Original comment by joe.wreschnig@gmail.com on 12 Dec 2010 at 9:14