diff options
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/client_api_examples/sdl/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/DOCS/client_api_examples/sdl/main.c b/DOCS/client_api_examples/sdl/main.c index 38d2cf57cc..8a489c06f0 100644 --- a/DOCS/client_api_examples/sdl/main.c +++ b/DOCS/client_api_examples/sdl/main.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) if (mpv_set_option_string(mpv, "vo", "opengl-cb") < 0) die("failed to set VO"); - // Play this file. Note that this asynchronously starts playback. - const char *cmd[] = {"loadfile", argv[1], NULL}; - mpv_command(mpv, cmd); - // We use events for thread-safe notification of the SDL main loop. wakeup_on_mpv_redraw = SDL_RegisterEvents(1); wakeup_on_mpv_events = SDL_RegisterEvents(1); @@ -90,6 +86,10 @@ int main(int argc, char *argv[]) // users which run OpenGL on a different thread.) mpv_opengl_cb_set_update_callback(mpv_gl, on_mpv_redraw, NULL); + // Play this file. Note that this asynchronously starts playback. + const char *cmd[] = {"loadfile", argv[1], NULL}; + mpv_command(mpv, cmd); + while (1) { SDL_Event event; if (SDL_WaitEvent(&event) != 1) |