# HG changeset patch # User Robert McIntyre # Date 1330979205 21600 # Node ID b82b181851033cb8eb93cfc6c31aa80e0d51eae7 # Parent 6bde5b67a2b859b8e69105012bed2d9a229a7201 fixed Segfault but the recorded movie now lacks keypresses diff -r 6bde5b67a2b8 -r b82b18185103 src/common/movie.cpp --- a/src/common/movie.cpp Mon Mar 05 01:58:52 2012 -0600 +++ b/src/common/movie.cpp Mon Mar 05 14:26:45 2012 -0600 @@ -365,12 +365,13 @@ gbEchoRAMFixOn = 1; gbNullInputHackTempEnabled = gbNullInputHackEnabled; - + if (Movie.inputBuffer) { free(Movie.inputBuffer); Movie.inputBuffer = NULL; } + } else if (new_state == MOVIE_STATE_PLAY) { @@ -510,6 +511,9 @@ resetSignaled = false; resetSignaledLast = false; + + // RLM: should probably add inputBuffer initialization here. + reserve_buffer_space(90001); } void VBAMovieGetRomInfo(const SMovie &movieInfo, char romTitle [12], uint32 &romGameCode, uint16 &checksum, uint8 &crc) @@ -1180,7 +1184,9 @@ printf("RLM: Movie_STATE_RECORD\n"); // use first fseek? //TODO: THis is the problem. - fwrite(Movie.inputBufferPtr, 1, Movie.bytesPerFrame, Movie.file); + if (Movie.inputBuffer){ + fwrite(Movie.inputBufferPtr, 1, Movie.bytesPerFrame, Movie.file); + } printf("RLM: write successful.\n"); Movie.header.length_frames = Movie.currentFrame; Movie.inputBufferPtr += Movie.bytesPerFrame;