diff options
author | Thiago Santos <ts.santos@partner.samsung.com> | 2013-09-24 16:47:52 -0700 |
---|---|---|
committer | Thiago Santos <ts.santos@partner.samsung.com> | 2013-10-01 17:53:05 -0300 |
commit | f8d8a56d7bb594d2f7de2d73bb435d19139df2b8 (patch) | |
tree | fa2e9912b54dc6795ddea26e622e315bfc6b67bc | |
parent | 019ef0747dabddb873babbfc91ee77b26e574adf (diff) |
playbin: make sure elements are in null before disposing
If a pipeline fails to preroll, it might happen that the sinks are
put into READY state from playbin's sink activation, but they are never
set to playsink, so they aren't being managed by a GstBin and will keep
their READY state until they are unreffed, leading to a warning.
Prevent this by always forcing them to NULL when deactivating a group
https://bugzilla.gnome.org/show_bug.cgi?id=708789
-rw-r--r-- | gst/playback/gstplaybin2.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 91dbb0e3c..fc02ca332 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -5226,15 +5226,31 @@ deactivate_group (GstPlayBin * playbin, GstSourceGroup * group) combine->combiner = NULL; } } - /* delete any custom sinks we might have */ - if (group->audio_sink) + /* delete any custom sinks we might have. + * conditionally set them to null if they aren't inside playsink yet */ + if (group->audio_sink) { + if (!gst_object_has_ancestor (GST_OBJECT_CAST (group->audio_sink), + GST_OBJECT_CAST (playbin->playsink))) { + gst_element_set_state (group->audio_sink, GST_STATE_NULL); + } gst_object_unref (group->audio_sink); + } group->audio_sink = NULL; - if (group->video_sink) + if (group->video_sink) { + if (!gst_object_has_ancestor (GST_OBJECT_CAST (group->video_sink), + GST_OBJECT_CAST (playbin->playsink))) { + gst_element_set_state (group->video_sink, GST_STATE_NULL); + } gst_object_unref (group->video_sink); + } group->video_sink = NULL; - if (group->text_sink) + if (group->text_sink) { + if (!gst_object_has_ancestor (GST_OBJECT_CAST (group->text_sink), + GST_OBJECT_CAST (playbin->playsink))) { + gst_element_set_state (group->text_sink, GST_STATE_NULL); + } gst_object_unref (group->text_sink); + } group->text_sink = NULL; if (group->uridecodebin) { |