mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
encodebin: Fix stream_group_free when creating it went bad
Avoiding trying to use NULL pointers
This commit is contained in:
parent
28f4e7db12
commit
fe0e51914a
1 changed files with 21 additions and 17 deletions
|
@ -2032,6 +2032,7 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup)
|
||||||
if (sgroup->restriction_sid != 0)
|
if (sgroup->restriction_sid != 0)
|
||||||
g_signal_handler_disconnect (sgroup->profile, sgroup->restriction_sid);
|
g_signal_handler_disconnect (sgroup->profile, sgroup->restriction_sid);
|
||||||
|
|
||||||
|
if (sgroup->outqueue) {
|
||||||
if (ebin->muxer) {
|
if (ebin->muxer) {
|
||||||
/* outqueue - Muxer */
|
/* outqueue - Muxer */
|
||||||
tmppad = gst_element_get_static_pad (sgroup->outqueue, "src");
|
tmppad = gst_element_get_static_pad (sgroup->outqueue, "src");
|
||||||
|
@ -2047,8 +2048,8 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup)
|
||||||
}
|
}
|
||||||
gst_object_unref (tmppad);
|
gst_object_unref (tmppad);
|
||||||
}
|
}
|
||||||
if (sgroup->outqueue)
|
|
||||||
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
|
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (sgroup->formatter) {
|
if (sgroup->formatter) {
|
||||||
/* capsfilter - formatter - outqueue */
|
/* capsfilter - formatter - outqueue */
|
||||||
|
@ -2056,13 +2057,16 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup)
|
||||||
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
|
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
|
||||||
gst_element_unlink (sgroup->formatter, sgroup->outqueue);
|
gst_element_unlink (sgroup->formatter, sgroup->outqueue);
|
||||||
gst_element_unlink (sgroup->outfilter, sgroup->formatter);
|
gst_element_unlink (sgroup->outfilter, sgroup->formatter);
|
||||||
} else {
|
} else if (sgroup->outfilter) {
|
||||||
/* Capsfilter - outqueue */
|
/* Capsfilter - outqueue */
|
||||||
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
|
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
|
||||||
gst_element_unlink (sgroup->outfilter, sgroup->outqueue);
|
gst_element_unlink (sgroup->outfilter, sgroup->outqueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sgroup->outqueue) {
|
||||||
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
|
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
|
||||||
gst_bin_remove (GST_BIN (ebin), sgroup->outqueue);
|
gst_bin_remove (GST_BIN (ebin), sgroup->outqueue);
|
||||||
|
}
|
||||||
|
|
||||||
/* streamcombiner - parser - capsfilter */
|
/* streamcombiner - parser - capsfilter */
|
||||||
if (sgroup->parser) {
|
if (sgroup->parser) {
|
||||||
|
|
Loading…
Reference in a new issue