Skip to content

Commit

Permalink
don't keep short HTOA's if their peak level is low
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeLametta committed Nov 29, 2015
1 parent a95fc47 commit 468d6cb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions morituri/rip/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from morituri.extern.command import command


SILENT = 1e-10
MAX_TRIES = 5


Expand Down Expand Up @@ -405,8 +406,18 @@ def ripIfNotRipped(number):
# overlay this rip onto the Table
if number == 0:
# HTOA goes on index 0 of track 1
self.itable.setFile(1, 0, trackResult.filename,
self.ittoc.getTrackStart(1), number)
# ignore silence in PREGAP
if trackResult.peak <= SILENT:
self.debug('HTOA peak %r is below SILENT threshold, disregarding', trackResult.peak)
self.itable.setFile(1, 0, None,
self.ittoc.getTrackStart(1), number)
self.debug('Unlinking %r', trackResult.filename)
os.unlink(trackResult.filename)
trackResult.filename = None
self.stdout.write('HTOA discarded, contains digital silence\n')
else:
self.itable.setFile(1, 0, trackResult.filename,
self.ittoc.getTrackStart(1), number)
else:
self.itable.setFile(number, 1, trackResult.filename,
self.ittoc.getTrackLength(number), number)
Expand Down

0 comments on commit 468d6cb

Please sign in to comment.