Fix .log -> .dat for the first chunk, and make sure it bails if the load fails
Jeffrey Pfau jeffrey@endrift.com
Wed, 30 Jul 2014 00:03:19 -0700
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
src/gba/gba-rr.c
→
src/gba/gba-rr.c
@@ -94,8 +94,12 @@ return false;
} char buffer[14]; - snprintf(buffer, sizeof(buffer), "%u.log", rr->streamId); + snprintf(buffer, sizeof(buffer), "%u" BINEXT, rr->streamId); rr->movieStream = rr->streamDir->openFile(rr->streamDir, buffer, O_RDONLY); + if (!rr->movieStream) { + return false; + } + rr->autorecord = autorecord; rr->peekedTag = TAG_INVALID; _readTag(rr, rr->movieStream); // Discard the buffer@@ -127,7 +131,7 @@ return false;
} char buffer[14]; - snprintf(buffer, sizeof(buffer), "%u.log", rr->streamId); + snprintf(buffer, sizeof(buffer), "%u" BINEXT, rr->streamId); rr->movieStream = rr->streamDir->openFile(rr->streamDir, buffer, O_TRUNC | O_CREAT | O_WRONLY); if (!_emitTag(rr, rr->movieStream, TAG_BEGIN)) { rr->movieStream->close(rr->movieStream);