Fix .log -> .dat for the first chunk, and make sure it bails if the load fails

This commit is contained in:
Jeffrey Pfau 2014-07-30 00:03:19 -07:00
parent 9cc97410d3
commit 28218b2465
1 changed files with 6 additions and 2 deletions

View File

@ -94,8 +94,12 @@ bool GBARRStartPlaying(struct GBARRContext* rr, bool autorecord) {
}
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 @@ bool GBARRStartRecording(struct GBARRContext* rr) {
}
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);