mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
mplex: fix pad release and cleanup
This commit is contained in:
parent
07db2da91c
commit
361d9d6f30
1 changed files with 5 additions and 2 deletions
|
@ -168,7 +168,8 @@ gst_mplex_finalize (GObject * object)
|
||||||
while (walk) {
|
while (walk) {
|
||||||
GstMplexPad *mpad = (GstMplexPad *) walk->data;
|
GstMplexPad *mpad = (GstMplexPad *) walk->data;
|
||||||
|
|
||||||
gst_object_unref (mpad->pad);
|
if (mpad->pad)
|
||||||
|
gst_object_unref (mpad->pad);
|
||||||
mpad->pad = NULL;
|
mpad->pad = NULL;
|
||||||
walk = walk->next;
|
walk = walk->next;
|
||||||
}
|
}
|
||||||
|
@ -660,12 +661,14 @@ gst_mplex_release_pad (GstElement * element, GstPad * pad)
|
||||||
|
|
||||||
GST_MPLEX_MUTEX_LOCK (mplex);
|
GST_MPLEX_MUTEX_LOCK (mplex);
|
||||||
mpad->eos = TRUE;
|
mpad->eos = TRUE;
|
||||||
gst_object_unref (mpad->pad);
|
g_assert (mpad->pad == pad);
|
||||||
mpad->pad = NULL;
|
mpad->pad = NULL;
|
||||||
/* wake up if waiting on this pad */
|
/* wake up if waiting on this pad */
|
||||||
GST_MPLEX_SIGNAL (mplex, mpad);
|
GST_MPLEX_SIGNAL (mplex, mpad);
|
||||||
|
|
||||||
padname = gst_object_get_name (GST_OBJECT (pad));
|
padname = gst_object_get_name (GST_OBJECT (pad));
|
||||||
|
/* now only drop what might be last ref */
|
||||||
|
gst_object_unref (pad);
|
||||||
if (strstr (padname, "audio")) {
|
if (strstr (padname, "audio")) {
|
||||||
mplex->num_apads--;
|
mplex->num_apads--;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue