From 4fa2315557e26db436a8935ba74e06393e5756ef Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 20 Mar 2013 14:02:48 +0100 Subject: [PATCH] plugins: fix creation of video buffer from another source buffer. gst_vaapi_video_buffer_new_from_buffer() needs to reference the source buffer video meta since it would be unreference'd from the get_buffer() helper function. For other cases, we still use (steal) the newly created video meta. --- gst/vaapi/gstvaapipluginbuffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapipluginbuffer.c b/gst/vaapi/gstvaapipluginbuffer.c index 305eee886b..37171edf1d 100644 --- a/gst/vaapi/gstvaapipluginbuffer.c +++ b/gst/vaapi/gstvaapipluginbuffer.c @@ -70,7 +70,11 @@ gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool) GstBuffer * gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer) { - return get_buffer(gst_buffer_get_vaapi_video_meta(buffer)); + GstVaapiVideoMeta * const meta = gst_buffer_get_vaapi_video_meta(buffer); + + if (!meta) + return NULL; + return get_buffer(gst_vaapi_video_meta_ref(meta)); } GstBuffer *