Browse code

lavd/opengl_enc: simplify opengl_load_procedures usage

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>

Lukasz Marek authored on 2014/02/02 01:14:40
Showing 1 changed files
... ...
@@ -459,6 +459,11 @@ static int av_cold opengl_load_procedures(OpenGLContext *opengl)
459 459
 {
460 460
     FFOpenGLFunctions *procs = &opengl->glprocs;
461 461
 
462
+#if HAVE_SDL
463
+    if (!opengl->no_window)
464
+        return opengl_sdl_load_procedures(opengl);
465
+#endif
466
+
462 467
     procs->glActiveTexture = glActiveTexture;
463 468
     procs->glGenBuffers = glGenBuffers;
464 469
     procs->glDeleteBuffers = glDeleteBuffers;
... ...
@@ -504,6 +509,11 @@ static int av_cold opengl_load_procedures(OpenGLContext *opengl)
504 504
         return AVERROR(ENOSYS); \
505 505
     }
506 506
 
507
+#if HAVE_SDL
508
+    if (!opengl->no_window)
509
+        return opengl_sdl_load_procedures(opengl);
510
+#endif
511
+
507 512
     LOAD_OPENGL_FUN(glActiveTexture, FF_PFNGLACTIVETEXTUREPROC)
508 513
     LOAD_OPENGL_FUN(glGenBuffers, FF_PFNGLGENBUFFERSPROC)
509 514
     LOAD_OPENGL_FUN(glDeleteBuffers, FF_PFNGLDELETEBUFFERSPROC)
... ...
@@ -1064,12 +1074,7 @@ static av_cold int opengl_write_header(AVFormatContext *h)
1064 1064
         goto fail;
1065 1065
     }
1066 1066
 
1067
-    if (!opengl->no_window) {
1068
-#if HAVE_SDL
1069
-        if ((ret = opengl_sdl_load_procedures(opengl)) < 0)
1070
-            goto fail;
1071
-#endif
1072
-    } else if ((ret = opengl_load_procedures(opengl)) < 0)
1067
+    if ((ret = opengl_load_procedures(opengl)) < 0)
1073 1068
         goto fail;
1074 1069
 
1075 1070
     opengl_fill_color_map(opengl);