Skip to content
Snippets Groups Projects
Commit bb7246ef authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Jean-Baptiste Kempf
Browse files

glspectrum: keep the OpenGL context current

There is no need to disable and enable the context between each
rendering. Since we own both the context and the thread, we can just
keep it as current until the thread is closed, simplifying the already
missing error handling.
parent bd7eefb7
No related branches found
No related tags found
1 merge request!238Refactor OpenGL usage in glspectrum visualization
Pipeline #176881 passed with stages
in 22 minutes and 15 seconds
......@@ -439,15 +439,12 @@ static void *Thread( void *p_data )
struct glspectrum_opengl_vtable *vt = &p_sys->vt;
initOpenGLScene(p_filter);
vlc_gl_ReleaseCurrent(gl);
float height[NB_BANDS] = {0};
while ((block = vlc_queue_DequeueKillable(&p_sys->queue, &p_sys->dead)))
{
unsigned win_width, win_height;
vlc_gl_MakeCurrent(gl);
if (vlc_gl_surface_CheckSize(gl, &win_width, &win_height))
vt->Viewport(0, 0, win_width, win_height);
......@@ -573,9 +570,9 @@ static void *Thread( void *p_data )
release:
window_close(&wind_ctx);
fft_close(p_state);
vlc_gl_ReleaseCurrent(gl);
block_Release(block);
}
vlc_gl_ReleaseCurrent(gl);
return NULL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment