Skip to content

Commit

Permalink
Use Fast version of AccurateRipChecksumTask
Browse files Browse the repository at this point in the history
There are still some changes required to make whipper handle ARv2 checksums,
currently doesn't call the Task for a V2 checksum. V1 should keep working as-is.
  • Loading branch information
MerlijnWajer committed Oct 15, 2016
1 parent 9ae279c commit bce359f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions morituri/common/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ def _verifyImageWithChecksums(self, responses, checksums):
else:
trackResult.ARDBCRC = int(response.checksums[i], 16)

# TODO MW: Update this further for ARv2 code
def getAccurateRipResults(self):
"""
@rtype: list of str
Expand Down
7 changes: 4 additions & 3 deletions morituri/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class AccurateRipChecksumTask(log.Loggable, task.MultiSeparateTask):

description = "Checksumming tracks"

# TODO MW: Update this further for V2 code
def __init__(self, image):
task.MultiSeparateTask.__init__(self)

Expand All @@ -134,10 +135,10 @@ def __init__(self, image):
# here to avoid import gst eating our options
from morituri.common import checksum

checksumTask = checksum.AccurateRipChecksumTask(path,
checksumTask = checksum.FastAccurateRipChecksumTask(path,
trackNumber=trackIndex + 1, trackCount=len(cue.table.tracks),
sampleStart=index.relative * common.SAMPLES_PER_FRAME,
sampleLength=length * common.SAMPLES_PER_FRAME)
wave=True, v2=False)

self.addTask(checksumTask)

def stop(self):
Expand Down
6 changes: 4 additions & 2 deletions morituri/rip/offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def match(archecksum, track, responses):
self.stdout.write('No matching offset found.\n')
self.stdout.write('Consider trying again with a different disc.\n')

# TODO MW: Update this further for ARv2 code
def _arcs(self, runner, table, track, offset):
# rips the track with the given offset, return the arcs checksum
self.debug('Ripping track %r with offset %d ...', track, offset)
Expand All @@ -226,8 +227,9 @@ def _arcs(self, runner, table, track, offset):
# here to avoid import gst eating our options
from morituri.common import checksum

t = checksum.AccurateRipChecksumTask(path, trackNumber=track,
trackCount=len(table.tracks))
# TODO MW: Update this to also use the v2 checksum(s)
t = checksum.FastAccurateRipChecksumTask(path, trackNumber=track,
trackCount=len(table.tracks), wave=True, v2=False)
runner.run(t)

os.unlink(path)
Expand Down

0 comments on commit bce359f

Please sign in to comment.