mirror of https://github.com/snes9xgit/snes9x.git
movie: Fix desync problem introduced by today's update, by moving the first read/write frame data process to more safer position. (give proper frame count and state before calling it)
This commit is contained in:
parent
8fe66bdc44
commit
ebc92a6681
13
movie.cpp
13
movie.cpp
|
@ -841,10 +841,6 @@ int S9xMovieOpen (const char *filename, bool8 read_only)
|
|||
size_t ignore;
|
||||
ignore = fread(Movie.InputBufferPtr, 1, Movie.BytesPerSample * (Movie.MaxSample + 1), fd);
|
||||
|
||||
// read "baseline" controller data
|
||||
if (Movie.MaxSample && Movie.MaxFrame)
|
||||
read_frame_controller_data(true);
|
||||
|
||||
Movie.CurrentFrame = 0;
|
||||
Movie.CurrentSample = 0;
|
||||
Movie.ReadOnly = read_only;
|
||||
|
@ -855,6 +851,10 @@ int S9xMovieOpen (const char *filename, bool8 read_only)
|
|||
|
||||
change_state(MOVIE_STATE_PLAY);
|
||||
|
||||
// read "baseline" controller data
|
||||
if (Movie.MaxSample && Movie.MaxFrame)
|
||||
read_frame_controller_data(true);
|
||||
|
||||
S9xUpdateFrameCounter(-1);
|
||||
|
||||
S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REPLAY);
|
||||
|
@ -945,11 +945,9 @@ int S9xMovieCreate (const char *filename, uint8 controllers_mask, uint8 opts, co
|
|||
Movie.ControllerDataOffset++;
|
||||
}
|
||||
|
||||
// write "baseline" controller data
|
||||
Movie.File = fd;
|
||||
Movie.BytesPerSample = bytes_per_sample();
|
||||
Movie.InputBufferPtr = Movie.InputBuffer;
|
||||
write_frame_controller_data();
|
||||
|
||||
Movie.CurrentFrame = 0;
|
||||
Movie.CurrentSample = 0;
|
||||
|
@ -959,6 +957,9 @@ int S9xMovieCreate (const char *filename, uint8 controllers_mask, uint8 opts, co
|
|||
|
||||
change_state(MOVIE_STATE_RECORD);
|
||||
|
||||
// write "baseline" controller data
|
||||
write_frame_controller_data();
|
||||
|
||||
S9xUpdateFrameCounter(-1);
|
||||
|
||||
S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_RECORD);
|
||||
|
|
Loading…
Reference in New Issue