From bee7460f3541f5eb3f6511ca8d74c3ce6533bf62 Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Tue, 27 Jan 2015 16:25:21 +0200 Subject: [PATCH] pluginutil: Fix clearing of subtitle overlay dvbsuboverlay signals no subtitles present by not setting GstVideoOverlayCompositionMeta on a buffer. Detect this, and remove subtitles whenever we have no overlay composition to hand. Signed-off-by: Simon Farnsworth --- gst/vaapi/gstvaapipluginutil.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 7b0ced4c8b..21f7e03dd7 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -347,17 +347,14 @@ gst_vaapi_apply_composition (GstVaapiSurface * surface, GstBuffer * buffer) #if GST_CHECK_VERSION(1,0,0) GstVideoOverlayCompositionMeta *const cmeta = gst_buffer_get_video_overlay_composition_meta (buffer); - GstVideoOverlayComposition *composition; + GstVideoOverlayComposition *composition = NULL; - if (!cmeta) - return TRUE; - composition = cmeta->overlay; + if (cmeta) + composition = cmeta->overlay; #else GstVideoOverlayComposition *const composition = gst_video_buffer_get_overlay_composition (buffer); #endif - if (!composition) - return TRUE; return gst_vaapi_surface_set_subpictures_from_composition (surface, composition, TRUE); }