mirror of
https://github.com/bkerler/edl.git
synced 2024-11-14 19:14:58 -05:00
fix sparse get size()
This commit is contained in:
parent
31892ae1b2
commit
fbf9157df5
1 changed files with 3 additions and 3 deletions
|
@ -81,20 +81,21 @@ class QCSparse(metaclass=LogBase):
|
||||||
chunk_sz = header[2]
|
chunk_sz = header[2]
|
||||||
total_sz = header[3]
|
total_sz = header[3]
|
||||||
data_sz = total_sz - 12
|
data_sz = total_sz - 12
|
||||||
|
self.rf.seek(self.rf.tell + data_sz)
|
||||||
|
|
||||||
if chunk_type == 0xCAC1:
|
if chunk_type == 0xCAC1:
|
||||||
if data_sz != (chunk_sz * self.blk_sz):
|
if data_sz != (chunk_sz * self.blk_sz):
|
||||||
self.error(
|
self.error(
|
||||||
"Raw chunk input size (%u) does not match output size (%u)" % (data_sz, chunk_sz * self.blk_sz))
|
"Raw chunk input size (%u) does not match output size (%u)" % (data_sz, chunk_sz * self.blk_sz))
|
||||||
return -1
|
return -1
|
||||||
else:
|
else:
|
||||||
self.rf.seek(self.rf.tell() + chunk_sz * self.blk_sz)
|
|
||||||
return chunk_sz * self.blk_sz
|
return chunk_sz * self.blk_sz
|
||||||
elif chunk_type == 0xCAC2:
|
elif chunk_type == 0xCAC2:
|
||||||
if data_sz != 4:
|
if data_sz != 4:
|
||||||
self.error("Fill chunk should have 4 bytes of fill, but this has %u" % data_sz)
|
self.error("Fill chunk should have 4 bytes of fill, but this has %u" % data_sz)
|
||||||
return -1
|
return -1
|
||||||
else:
|
else:
|
||||||
return chunk_sz * self.blk_sz // 4
|
return chunk_sz * self.blk_sz
|
||||||
elif chunk_type == 0xCAC3:
|
elif chunk_type == 0xCAC3:
|
||||||
return chunk_sz * self.blk_sz
|
return chunk_sz * self.blk_sz
|
||||||
elif chunk_type == 0xCAC4:
|
elif chunk_type == 0xCAC4:
|
||||||
|
@ -102,7 +103,6 @@ class QCSparse(metaclass=LogBase):
|
||||||
self.error("CRC32 chunk should have 4 bytes of CRC, but this has %u" % data_sz)
|
self.error("CRC32 chunk should have 4 bytes of CRC, but this has %u" % data_sz)
|
||||||
return -1
|
return -1
|
||||||
else:
|
else:
|
||||||
self.rf.seek(self.rf.tell() + 4)
|
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
self.debug("Unknown chunk type 0x%04X" % chunk_type)
|
self.debug("Unknown chunk type 0x%04X" % chunk_type)
|
||||||
|
|
Loading…
Reference in a new issue