plugins: fix memory leaks through GstVideoMeta maps.

When GstVideoMeta maps were used, the supporting functions incorrectly
used gst_buffer_get_memory() instead of gst_buffer_peek_memory(), thus
always increasing the associated GstMemory reference count and giving
zero chance to actually release that, and subsequently the VA display.
This commit is contained in:
Gwenole Beauchesne 2013-11-28 19:08:28 +01:00
parent 9ab6037847
commit 84b3f84925

View file

@ -123,7 +123,7 @@ gst_video_meta_map_vaapi_memory(GstVideoMeta *meta, guint plane,
GstMapInfo *info, gpointer *data, gint *stride, GstMapFlags flags)
{
GstVaapiVideoMemory * const mem =
GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_get_memory(meta->buffer, 0));
GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_peek_memory(meta->buffer, 0));
g_return_val_if_fail(mem, FALSE);
g_return_val_if_fail(GST_VAAPI_IS_VIDEO_ALLOCATOR(mem->parent_instance.
@ -196,7 +196,7 @@ gst_video_meta_unmap_vaapi_memory(GstVideoMeta *meta, guint plane,
GstMapInfo *info)
{
GstVaapiVideoMemory * const mem =
GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_get_memory(meta->buffer, 0));
GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_peek_memory(meta->buffer, 0));
g_return_val_if_fail(mem, FALSE);
g_return_val_if_fail(GST_VAAPI_IS_VIDEO_ALLOCATOR(mem->parent_instance.