From 03c21f78b6ef4a5e0bf2892d0500dfc44ad66970 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Sun, 21 Sep 2014 21:36:49 +1000 Subject: [PATCH] glupload: provide the output buffer that is rendered into Allows callers to properly reference count the buffers used for rendering. Fixes a redraw race in glimagesink where the previous buffer (the one used for redraw operations) is freed as soon as the next buffer is uploaded. 1. glimagesink uploads in _prepare() to texture n 1.1 glupload holds buffer n 2. glimagesink _render()s texture n 3. glimagesink uploads texture n+1 3.1 glupload free previous buffer which deletes texture n 3.2 glupload holds buffer n+1 4. glwindow resize/expose 5. glimagesink redraws with texture n The race is that the buffer n (the one used for redrawing) is freed as soon as the buffer n+1 arrives. There could be any amount of time and number of redraws between this event and when buffer n+1 is actually rendered and thus replaces buffer n as the redraw source. https://bugzilla.gnome.org/show_bug.cgi?id=736740 --- ext/gl/gstglmixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index 72291a8bad..3fcd728f17 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -882,7 +882,7 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) } if (!gst_gl_upload_perform_with_buffer (pad->upload, - vaggpad->buffer, &in_tex)) { + vaggpad->buffer, &in_tex, NULL)) { ++array_index; pad->mapped = FALSE; continue;