examples/sdlshare: Call gst_init() a bit earlier in main()
authorSebastian Dröge <sebastian@centricular.com>
Wed, 13 Mar 2019 06:31:43 +0000 (07:31 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 30 Sep 2019 10:29:58 +0000 (13:29 +0300)
Let's not accidentally call other GStreamer API before that.

tests/examples/gl/sdl/sdlshare.c
tests/examples/gl/sdl/sdlshare2.c

index 77f48f1..45a4f47 100644 (file)
@@ -311,6 +311,8 @@ main (int argc, char **argv)
     return -1;
   }
 
+  gst_init (&argc, &argv);
+
   SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2);
   SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 0);
 
@@ -329,8 +331,6 @@ main (int argc, char **argv)
 
   sdl_gl_context = SDL_GL_CreateContext (sdl_window);
 
-  gst_init (&argc, &argv);
-
   SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);
 
   /* Loop, drawing and checking events */
index 41e37f2..a516ad5 100644 (file)
@@ -311,6 +311,8 @@ main (int argc, char **argv)
     return -1;
   }
 
+  gst_init (&argc, &argv);
+
   SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2);
   SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 0);
 
@@ -331,7 +333,6 @@ main (int argc, char **argv)
     return -1;
   }
 
-  gst_init (&argc, &argv);
   loop = g_main_loop_new (NULL, FALSE);
 
   SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);