From d5dcc19a006f898f21a5b081180a132c9dc6e638 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 3 Oct 2012 17:57:51 +0200 Subject: use ffmpeg API to set a recorded frames presentation timestamp * fixes asynchronity of displayed and recorded graphics * also use the configured framerate instead of a hardcoded one --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8fd714f..d353a52 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,6 +56,7 @@ static Recorder recorder; LayerList layers; int config_dump_osc = 0; +int config_framerate = DEFAULT_FRAMERATE; void rgba_blit_with_alpha(SDL_Surface *src_surf, SDL_Surface *dst_surf, Uint8 alpha) @@ -240,11 +241,10 @@ main(int argc, char **argv) int width = DEFAULT_SCREEN_WIDTH; int height = DEFAULT_SCREEN_HEIGHT; int bpp = DEFAULT_SCREEN_BPP; - int framerate = DEFAULT_FRAMERATE; parse_options(argc, argv, port, sdl_flags, show_cursor, - width, height, bpp, framerate); + width, height, bpp, config_framerate); if (SDL_Init(SDL_INIT_VIDEO)) { SDL_ERROR("SDL_Init"); @@ -279,7 +279,7 @@ main(int argc, char **argv) osc_server.start(); SDL_initFramerate(&fpsm); - SDL_setFramerate(&fpsm, framerate); + SDL_setFramerate(&fpsm, config_framerate); for (;;) { sdl_process_events(); -- cgit v1.2.3