diff options
author | Damien Zammit <damien@zamaudio.com> | 2018-10-07 16:16:02 +1100 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2018-10-07 16:16:02 +1100 |
commit | 66a4c975d8f9998a76a540a91e30b93aa1c587d6 (patch) | |
tree | 43ef142339ed6a5c4ca86ba53188397ac7558623 | |
parent | 56ede510ab94b3d4b8e45ffed64631f6333bf462 (diff) |
libptformat: Update to upstream 50451ac (+source length)
-rw-r--r-- | libs/ptformat/ptfformat.cc | 22 |
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 |