buffer-sharing: fix bug of vaapi buffer leak
[adaptation/intel_mfld/gst-plugins-atomisp.git] / gst / mfldv4l2cam / v4l2camsrc_calls.c
index d6a600a..57f6bc1 100644 (file)
@@ -594,7 +594,6 @@ gst_v4l2camsrc_buffer_pool_destroy (GstMFLDV4l2CamSrcBufferPool * pool,
 
   g_mutex_lock (pool->lock);
   pool->running = FALSE;
-  pool->is_vaapi_sharing = FALSE;
   g_mutex_unlock (pool->lock);
 
   GST_DEBUG ("destroy pool");
@@ -624,7 +623,7 @@ gst_v4l2camsrc_buffer_pool_destroy (GstMFLDV4l2CamSrcBufferPool * pool,
       gst_buffer_unref (buf);
     }
   }
-
+  pool->is_vaapi_sharing = FALSE;
   gst_mini_object_unref (GST_MINI_OBJECT (pool));
 }