summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2018-10-10 20:21:29 +1100
committerDamien Zammit <damien@zamaudio.com>2018-10-12 19:09:40 +1100
commitca6c11dbcacfe4af8f528263739a17f764ea0126 (patch)
treeeb7187c1d2b0ae0f6e2a4943a7f4596892e3ba19
parent2a9af2d2f6aa9025adabf2f9bc6e42c65b43c08a (diff)
libptformat: Update lib to upstream e75320e (+source lengths)
-rw-r--r--libs/ptformat/ptfformat.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ptformat/ptfformat.cc b/libs/ptformat/ptfformat.cc
index 71c7d479cf..774142cad7 100644
--- a/libs/ptformat/ptfformat.cc
+++ b/libs/ptformat/ptfformat.cc
@@ -1273,6 +1273,28 @@ PTFFormat::parseaudio(void) {
std::reverse(actualwavs.begin(), actualwavs.end());
//resort(audiofiles);
//resort(actualwavs);
+
+ // Jump to end of wav file list
+ if (!jumpto(&k, ptfunxored, len, (const unsigned char *)"\xff\xff\xff\xff", 4))
+ return;
+
+ // Loop through all the sources
+ for (vector<wav_t>::iterator w = audiofiles.begin(); w != audiofiles.end(); ++w) {
+ // Jump to start of source metadata for this source
+ if (!jumpto(&k, ptfunxored, len, (const unsigned char *)"\x5a\x07", 2))
+ return;
+ if (!jumpto(&k, ptfunxored, len, (const unsigned char *)"\x5a\x02", 2))
+ return;
+ k++;
+ if (!jumpto(&k, ptfunxored, len, (const unsigned char *)"\x5a\x02", 2))
+ return;
+
+ w->length = 0;
+ w->length |= (uint32_t)(ptfunxored[k-22]) << 24;
+ w->length |= (uint32_t)(ptfunxored[k-23]) << 16;
+ w->length |= (uint32_t)(ptfunxored[k-24]) << 8;
+ w->length |= (uint32_t)(ptfunxored[k-25]);
+ }
}
void