mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
examples/overlay: unref sink only when found
In gtk-videooverlay and qt-videooverlay examples.
This commit is contained in:
parent
4305e1c33e
commit
e0dfbe9dfa
2 changed files with 8 additions and 6 deletions
|
@ -57,8 +57,8 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
if ((sink = gst_element_factory_make ("ximagesink", NULL))) {
|
||||
sret = gst_element_set_state (sink, GST_STATE_READY);
|
||||
|
@ -66,8 +66,8 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
if (strcmp (DEFAULT_VIDEOSINK, "xvimagesink") == 0 ||
|
||||
strcmp (DEFAULT_VIDEOSINK, "ximagesink") == 0)
|
||||
|
@ -84,8 +84,9 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
if ((sink = gst_element_factory_make ("ximagesink", NULL))) {
|
||||
sret = gst_element_set_state (sink, GST_STATE_READY);
|
||||
|
@ -55,8 +55,8 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
if (strcmp (DEFAULT_VIDEOSINK, "xvimagesink") == 0 ||
|
||||
strcmp (DEFAULT_VIDEOSINK, "ximagesink") == 0)
|
||||
|
@ -73,8 +73,9 @@ find_video_sink (void)
|
|||
return sink;
|
||||
|
||||
gst_element_set_state (sink, GST_STATE_NULL);
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
gst_object_unref (sink);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue