eglglessink: Store a reference to the last_buffer if using EGLImages
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 22 Feb 2013 10:23:16 +0000 (11:23 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 3 Mar 2013 11:31:05 +0000 (12:31 +0100)
ext/eglgles/gsteglglessink.c

index e1de4b6bbee4a989f1ad8c1589ffd40ff70a63ab..77b419cd334ecbf2b269c24770088ee0e3e80817 100644 (file)
@@ -830,7 +830,7 @@ gst_eglglessink_stop (GstEglGlesSink * eglglessink)
   }
   eglglessink->last_flow = GST_FLOW_FLUSHING;
 
-  eglglessink->last_buffer = NULL;
+  gst_buffer_replace (&eglglessink->last_buffer, NULL);
 
   if (eglglessink->using_own_window) {
     platform_destroy_native_window (gst_egl_display_get
@@ -2223,7 +2223,7 @@ gst_eglglessink_upload (GstEglGlesSink * eglglessink, GstBuffer * buf)
         if (got_gl_error ("glEGLImageTargetTexture2DOES"))
           goto HANDLE_ERROR;
       }
-      eglglessink->last_buffer = buf;
+      gst_buffer_replace (&eglglessink->last_buffer, buf);
       eglglessink->stride[0] = 1;
       eglglessink->stride[1] = 1;
       eglglessink->stride[2] = 1;