diff --git a/Source/Core/Core/Src/OnFrame.cpp b/Source/Core/Core/Src/OnFrame.cpp index 62d777e716..032eb88f4e 100644 --- a/Source/Core/Core/Src/OnFrame.cpp +++ b/Source/Core/Core/Src/OnFrame.cpp @@ -228,7 +228,7 @@ bool BeginRecordingInput(int controllers) g_frameCounter = 0; g_lagCounter = 0; - + g_InputCounter = 0; g_playMode = MODE_RECORDING; Core::DisplayMessage("Starting movie recording", 2000); @@ -428,7 +428,8 @@ void LoadInput(const char *filename) g_frameCounter = header.frameCount; g_totalFrameCount = header.frameCount; - + g_InputCounter = header.InputCount; + g_numPads = header.numControllers; ChangePads(true); @@ -606,6 +607,7 @@ void SaveRecording(const char *filename) header.frameCount = g_frameCounter; header.lagCount = g_lagCounter; header.numRerecords = g_rerecords; + header.InputCount = g_InputCounter; // TODO header.uniqueID = 0; diff --git a/Source/Core/Core/Src/OnFrame.h b/Source/Core/Core/Src/OnFrame.h index f2ccff6906..f80d182886 100644 --- a/Source/Core/Core/Src/OnFrame.h +++ b/Source/Core/Core/Src/OnFrame.h @@ -48,7 +48,7 @@ struct ControllerState { u8 AnalogStickX, AnalogStickY; // Main Stick, 16 bits u8 CStickX, CStickY; // Sub-Stick, 16 bits -}; // Total: 58 + 6 = 64 bits per frame +}; // Total: 60 + 4 = 64 bits per frame #pragma pack(pop) // Global declarations @@ -78,6 +78,7 @@ struct DTMHeader { bool bFromSaveState; // false indicates that the recording started from bootup, true for savestate u64 frameCount; // Number of frames in the recording + u64 InputCount; // Number of input frames in recording u64 lagCount; // Number of lag frames in the recording u64 uniqueID; // A Unique ID comprised of: md5(time + Game ID) u32 numRerecords; // Number of rerecords/'cuts' of this TAS @@ -87,9 +88,7 @@ struct DTMHeader { u8 audioEmulator[16]; // UTF-8 representation of the audio emulator u8 padBackend[16]; // UTF-8 representation of the input backend - u8 padding[7]; // Padding to align the header to 1024 bits - - u8 reserved[128]; // Increasing size from 128 bytes to 256 bytes, just because we can + u8 reserved[127]; // Make heading 256 bytes, just because we can }; #pragma pack(pop) diff --git a/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp b/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp index 72643c617f..3d0eeaae96 100644 --- a/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/OpenCL/OCLTextureDecoder.cpp @@ -147,6 +147,7 @@ void TexDecoder_OpenCL_Initialize() delete binary; } + // If an error occurred using the kernel binary, recompile the kernels if (err) { std::string code; @@ -182,7 +183,7 @@ void TexDecoder_OpenCL_Initialize() binaries = (char **)malloc(sizeof(char *)*nDevices); for (u32 i = 0; i < nDevices; ++i) { - if( binary_sizes[i] != 0 ) + if (binary_sizes[i] != 0) { binaries[i] = (char *)malloc(HEADER_SIZE + binary_sizes[i]); } @@ -213,9 +214,23 @@ void TexDecoder_OpenCL_Initialize() output.WriteBytes(binaries[0], binary_sizes[0]); } } + for (u32 i = 0; i < nDevices; ++i) + { + if (binary_sizes[i] != NULL) + { + free(binaries[i]); + } + } + if (binaries != NULL) + free(binaries); + if (binary_sizes != NULL) + free(binary_sizes); + if (devices != NULL) + free(devices); } - for (int i = 0; i <= GX_TF_CMPR; ++i) { + for (int i = 0; i <= GX_TF_CMPR; ++i) + { if (g_DecodeParametersNative[i].name) g_DecodeParametersNative[i].kernel = OpenCL::CompileKernel(g_program,