kopia lustrzana https://github.com/OpenRTX/OpenRTX
Corrected vpDataOffset, now use ftell to obtain file offset after reading in header and toc. Added better verification that the TOC was actually read.
rodzic
e09ce7e95a
commit
6b83af622c
|
@ -114,13 +114,14 @@ void vpCacheInit(void)
|
|||
return;
|
||||
|
||||
fseek(voice_prompt_file, 0L, SEEK_SET);
|
||||
vpDataOffset += fread((void*)&header, sizeof(header), 1, voice_prompt_file);
|
||||
fread((void*)&header, sizeof(header), 1, voice_prompt_file);
|
||||
|
||||
if (vpCheckHeader((uint32_t*)&header))
|
||||
{ // read in the TOC.
|
||||
vpDataOffset += fread((void*)&tableOfContents, sizeof(tableOfContents), 1, voice_prompt_file);
|
||||
|
||||
vpDataIsLoaded = true;
|
||||
fread((void*)&tableOfContents, sizeof(tableOfContents), 1, voice_prompt_file);
|
||||
vpDataOffset = ftell(voice_prompt_file);
|
||||
if(vpDataOffset == (sizeof(voicePromptsDataHeader_t) + sizeof(tableOfContents)))
|
||||
vpDataIsLoaded = true;
|
||||
}
|
||||
if (vpDataIsLoaded)
|
||||
{ // if the hash key is down, set vpLevel to high, if beep or less.
|
||||
|
|
Ładowanie…
Reference in New Issue