Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions whipper/program/cdparanoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,17 @@ def getTrackQuality(self):
reads = self.reads
logger.debug('getTrackQuality: frames %d, reads %d' % (frames, reads))

# don't go over a 100%; we know cdparanoia reads each frame at least
# twice
try:
# don't go over a 100%
# we know that cdparanoia reads each frame at least twice
return min(frames * 2.0 / reads, 1.0)
except ZeroDivisionError:
return 0

raise RuntimeError("cdparanoia couldn't read any frames "
"for the current track")

# FIXME: handle errors


class ReadTrackTask(task.Task):
"""
I am a task that reads a track using cdparanoia.
Expand Down