diff options
author | Damien Zammit <damien@zamaudio.com> | 2015-07-25 03:03:15 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2015-07-25 03:03:15 +1000 |
commit | d549afffa950ee90cb6fab48e17445221ac26cc0 (patch) | |
tree | 1d852a7f987c8883e7a7c4baf5472f147b20f98b | |
parent | 5237fb4710e5e6a40347958df3586917bc2e8f85 (diff) |
Fixed offsets
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r-- | ptfformat.cc | 63 |
1 files changed, 19 insertions, 44 deletions
diff --git a/ptfformat.cc b/ptfformat.cc index 67aca6d..4ecd44c 100644 --- a/ptfformat.cc +++ b/ptfformat.cc @@ -331,58 +331,33 @@ PTFFormat::parse(void) { } } - // Number of other tracks - int n = this->othertracks.size(); - uint32_t offset; - k = 0; while (k < len) { if ( (ptfunxored[k ] == 0x5a) && - (ptfunxored[k+1] == 0x15) && - (ptfunxored[k+2] == 0x00)) { + (ptfunxored[k+1] == 0x06)) { break; } k++; } -/* - for (i = k; i < len-(80+n*8); i++) { - if ( (ptfunxored[i ] == 0x5a) && - (ptfunxored[i+1] == 0x01) && - (ptfunxored[i+2] == 0x00)) { + // Number of other tracks + uint32_t offset; + for (vector<files_t>::iterator of = + this->othertracks.begin(); + of != this->othertracks.end();) { + + if ( (ptfunxored[k ] == 0x5a) && + (ptfunxored[k+1] == 0x07)) { - j = i+79; - for (vector<files_t>::iterator of = - this->othertracks.begin(); - of != this->othertracks.end(); - of++) { + j = k+16; - //offset - offset = 0; - offset |= (uint32_t)(ptfunxored[j]); - offset |= (uint32_t)(ptfunxored[j+1] << 8); - offset |= (uint32_t)(ptfunxored[j+2] << 16); - offset |= (uint32_t)(ptfunxored[j+3] << 24); - of->posabsolute = (uint32_t)offset; - j+=8; - //start - offset = 0; - offset |= (uint32_t)(ptfunxored[j]); - offset |= (uint32_t)(ptfunxored[j+1] << 8); - offset |= (uint32_t)(ptfunxored[j+2] << 16); - offset |= (uint32_t)(ptfunxored[j+3] << 24); - of->sampleoffset = (uint32_t)offset; - j+=8; - //length - offset = 0; - offset |= (uint32_t)(ptfunxored[j]); - offset |= (uint32_t)(ptfunxored[j+1] << 8); - offset |= (uint32_t)(ptfunxored[j+2] << 16); - offset |= (uint32_t)(ptfunxored[j+3] << 24); - of->length = (uint32_t)offset; - j+=8; - } - break; + //offset + offset = 0; + offset |= (uint32_t)(ptfunxored[j]); + offset |= (uint32_t)(ptfunxored[j+1] << 8); + offset |= (uint32_t)(ptfunxored[j+2] << 16); + offset |= (uint32_t)(ptfunxored[j+3] << 24); + of->posabsolute = (uint32_t)offset; + of++; } - break; + k++; } -*/ } |