From 66a4c975d8f9998a76a540a91e30b93aa1c587d6 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sun, 7 Oct 2018 16:16:02 +1100 Subject: libptformat: Update to upstream 50451ac (+source length) --- libs/ptformat/ptfformat.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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::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 -- cgit v1.2.3