diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-08-01 15:00:46 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-08-01 15:00:46 +0200 |
commit | a0a9fd004b28b00472a393cebda534d3a8af5dc8 (patch) | |
tree | 9e92aae00da3f43255e1e46684aedbf5226111d2 | |
parent | b34e0ba91cc01511c395c1d4ee44ec1ccb8df165 (diff) |
playbin: Keep a reference to the playsink sinkpads
Otherwise playsink might get shut down without us noticing
that our pad references are gone now.
Probably fixes https://bugzilla.gnome.org/show_bug.cgi?id=733165
-rw-r--r-- | gst/playback/gstplaybin2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index b717ac905..7b2c8cb03 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3452,6 +3452,7 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group) GST_DEBUG_OBJECT (playbin, "requesting new sink pad %d", combine->type); combine->sinkpad = gst_play_sink_request_pad (playbin->playsink, combine->type); + gst_object_ref (combine->sinkpad); } else if (combine->srcpad && combine->sinkpad) { GST_DEBUG_OBJECT (playbin, "refreshing new sink pad %d", combine->type); gst_play_sink_refresh_pad (playbin->playsink, combine->sinkpad, @@ -3459,6 +3460,7 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group) } else if (combine->sinkpad && combine->srcpad == NULL) { GST_DEBUG_OBJECT (playbin, "releasing sink pad %d", combine->type); gst_play_sink_release_pad (playbin->playsink, combine->sinkpad); + gst_object_unref (combine->sinkpad); combine->sinkpad = NULL; } if (combine->sinkpad && combine->srcpad && @@ -3564,6 +3566,7 @@ shutdown: combine->sinkpad = gst_play_sink_request_pad (playbin->playsink, GST_PLAY_SINK_TYPE_FLUSHING); + gst_object_ref (combine->sinkpad); res = gst_pad_link (combine->srcpad, combine->sinkpad); GST_DEBUG_OBJECT (playbin, "linked flushing, result: %d", res); } @@ -5279,6 +5282,7 @@ deactivate_group (GstPlayBin * playbin, GstSourceGroup * group) /* release back */ GST_LOG_OBJECT (playbin, "release sink pad"); gst_play_sink_release_pad (playbin->playsink, combine->sinkpad); + gst_object_unref (combine->sinkpad); combine->sinkpad = NULL; } |