summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2015-08-03 05:36:24 +1000
committerDamien Zammit <damien@zamaudio.com>2015-08-03 05:36:24 +1000
commit6352445d9e1c274a4f1d107caf642179fbc4ec6d (patch)
treed44541c04cfaf0e4d565cff0822a013fc0915f00
parent55cd478eef776192d85554ecb74891fd2ac25e1a (diff)
Fixed offsets again
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r--ptfformat.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/ptfformat.cc b/ptfformat.cc
index 4634815..072be84 100644
--- a/ptfformat.cc
+++ b/ptfformat.cc
@@ -331,9 +331,9 @@ PTFFormat::parse(void) {
j += i+13;
//uint8_t disabled = ptfunxored[j];
- startbytes = (ptfunxored[j+1] & 0xf0) >> 4;
+ offsetbytes = (ptfunxored[j+1] & 0xf0) >> 4;
lengthbytes = (ptfunxored[j+2] & 0xf0) >> 4;
- offsetbytes = (ptfunxored[j+3] & 0xf0) >> 4;
+ startbytes = (ptfunxored[j+3] & 0xf0) >> 4;
somethingbytes = (ptfunxored[j+3] & 0xf);
skipbytes = ptfunxored[j+4];
findex = ptfunxored[j+5
@@ -351,20 +351,20 @@ PTFFormat::parse(void) {
+skipbytes
+24];
*/
- uint32_t start = 0;
- switch (startbytes) {
+ uint32_t sampleoffset = 0;
+ switch (offsetbytes) {
case 4:
- start |= (uint32_t)(ptfunxored[j+8] << 24);
+ sampleoffset |= (uint32_t)(ptfunxored[j+8] << 24);
case 3:
- start |= (uint32_t)(ptfunxored[j+7] << 16);
+ sampleoffset |= (uint32_t)(ptfunxored[j+7] << 16);
case 2:
- start |= (uint32_t)(ptfunxored[j+6] << 8);
+ sampleoffset |= (uint32_t)(ptfunxored[j+6] << 8);
case 1:
- start |= (uint32_t)(ptfunxored[j+5]);
+ sampleoffset |= (uint32_t)(ptfunxored[j+5]);
default:
break;
}
- j+=startbytes;
+ j+=offsetbytes;
uint32_t length = 0;
switch (lengthbytes) {
case 4:
@@ -379,20 +379,20 @@ PTFFormat::parse(void) {
break;
}
j+=lengthbytes;
- uint32_t sampleoffset = 0;
- switch (offsetbytes) {
+ uint32_t start = 0;
+ switch (startbytes) {
case 4:
- sampleoffset |= (uint32_t)(ptfunxored[j+8] << 24);
+ start |= (uint32_t)(ptfunxored[j+8] << 24);
case 3:
- sampleoffset |= (uint32_t)(ptfunxored[j+7] << 16);
+ start |= (uint32_t)(ptfunxored[j+7] << 16);
case 2:
- sampleoffset |= (uint32_t)(ptfunxored[j+6] << 8);
+ start |= (uint32_t)(ptfunxored[j+6] << 8);
case 1:
- sampleoffset |= (uint32_t)(ptfunxored[j+5]);
+ start |= (uint32_t)(ptfunxored[j+5]);
default:
break;
}
- j+=offsetbytes;
+ j+=startbytes;
uint32_t something = 0;
switch (somethingbytes) {
case 4: