Library scan freezes when mutagen raises an error

Bug #176126 reported by mamaar
2
Affects Status Importance Assigned to Milestone
Decibel Audio Player
Fix Released
Undecided
Anonym25712

Bug Description

The library scanning freezes when mutagen raises an error.

Traceback (most recent call last):
  File "/home/mamaar/projects/decibel-audio-player/src/modules/Library.py", line 182, in refreshLibrary
    files[filename] = [mTime, media.readInfo((tags[media.NFO_FIL],))[0]]
  File "/home/mamaar/projects/decibel-audio-player/src/media/__init__.py", line 63, in readInfo
    info.append(module.readInfo(file))
  File "/home/mamaar/projects/decibel-audio-player/src/media/mp3.py", line 42, in readInfo
    info[media.NFO_LEN] = int(MP3(file).info.length)
  File "/usr/lib/python2.5/site-packages/mutagen/__init__.py", line 75, in __init__
    self.load(filename, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/mutagen/id3.py", line 1921, in load
    self.info = self._Info(fileobj, offset)
  File "/usr/lib/python2.5/site-packages/mutagen/mp3.py", line 101, in __init__
    self.__try(fileobj, offset, size - offset, False)
  File "/usr/lib/python2.5/site-packages/mutagen/mp3.py", line 138, in __try
    raise HeaderNotFoundError("can't sync to an MPEG frame")
mutagen.mp3.HeaderNotFoundError: can't sync to an MPEG frame

Revision history for this message
mamaar (mamaar) wrote :

Here is a patch for the problem. Don't know if it's the best way to do it, but it removes the crash and I get my library loaded.

Revision history for this message
Anonym25712 (anonym25712) wrote :

Are you sure that file is actually a MP3 file, regardless of its extension? If so, it must be seriously broken.
Anyway, I'll add more checking there.

Changed in decibel-audio-player:
assignee: nobody → athropos
status: New → Confirmed
Changed in decibel-audio-player:
status: Confirmed → Fix Committed
Changed in decibel-audio-player:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.