Create bsv_movie_set_frame_start/bsv_movie_set_frame_end

This commit is contained in:
twinaphex 2017-01-22 16:59:55 +01:00
parent 5bc611c885
commit b04056db11
3 changed files with 12 additions and 17 deletions

17
movie.c
View File

@ -239,15 +239,16 @@ error:
}
/* Used for rewinding while playback/record. */
static void bsv_movie_set_frame_start(bsv_movie_t *handle)
void bsv_movie_set_frame_start(void)
{
if (!handle)
return;
handle->frame_pos[handle->frame_ptr] = ftell(handle->file);
bsv_movie_t *handle = bsv_movie_state.movie;
if (handle)
handle->frame_pos[handle->frame_ptr] = ftell(handle->file);
}
static void bsv_movie_set_frame_end(bsv_movie_t *handle)
void bsv_movie_set_frame_end(void)
{
bsv_movie_t *handle = bsv_movie_state.movie;
if (!handle)
return;
@ -401,12 +402,6 @@ bool bsv_movie_ctl(enum bsv_ctl_state state, void *data)
case BSV_MOVIE_CTL_INIT:
bsv_movie_init_state();
break;
case BSV_MOVIE_CTL_SET_FRAME_START:
bsv_movie_set_frame_start(bsv_movie_state.movie);
break;
case BSV_MOVIE_CTL_SET_FRAME_END:
bsv_movie_set_frame_end(bsv_movie_state.movie);
break;
case BSV_MOVIE_CTL_FRAME_REWIND:
bsv_movie_frame_rewind(bsv_movie_state.movie);
break;

View File

@ -57,8 +57,6 @@ enum bsv_ctl_state
BSV_MOVIE_CTL_UNSET_START_PLAYBACK,
BSV_MOVIE_CTL_START_PLAYBACK,
BSV_MOVIE_CTL_UNSET_PLAYBACK,
BSV_MOVIE_CTL_SET_FRAME_START,
BSV_MOVIE_CTL_SET_FRAME_END,
BSV_MOVIE_CTL_FRAME_REWIND,
BSV_MOVIE_CTL_DEINIT,
BSV_MOVIE_CTL_INIT,
@ -74,6 +72,10 @@ void bsv_movie_set_path(const char *path);
void bsv_movie_set_start_path(const char *path);
void bsv_movie_set_frame_start(void);
void bsv_movie_set_frame_end(void);
bool bsv_movie_ctl(enum bsv_ctl_state state, void *data);
bool bsv_movie_check(void);

View File

@ -1114,8 +1114,7 @@ int runloop_iterate(unsigned *sleep_ms)
autosave_lock();
if (bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL))
bsv_movie_ctl(BSV_MOVIE_CTL_SET_FRAME_START, NULL);
bsv_movie_set_frame_start();
camera_driver_ctl(RARCH_CAMERA_CTL_POLL, NULL);
@ -1157,8 +1156,7 @@ int runloop_iterate(unsigned *sleep_ms)
input_pop_analog_dpad(auto_binds);
}
if (bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL))
bsv_movie_ctl(BSV_MOVIE_CTL_SET_FRAME_END, NULL);
bsv_movie_set_frame_end();
autosave_unlock();