diff options
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -60,7 +60,6 @@ pad_blocked_cleanup_cb (GstPad *srcpad, GstPadProbeInfo *info, TranscodeClientCtx *ctx) { - GstPad *sinkpad; GstElement *tee; GstElement *sinkbin = GST_ELEMENT (gst_element_get_parent (ctx->appsink)); @@ -69,13 +68,12 @@ pad_blocked_cleanup_cb (GstPad *srcpad, gst_pad_remove_probe (srcpad, GST_PAD_PROBE_INFO_ID (info)); tee = gst_pad_get_parent_element (srcpad); - sinkpad = gst_element_get_static_pad (sinkbin, "qsink"); - gst_pad_unlink (srcpad, sinkpad); + gst_pad_unlink (srcpad, ctx->ghostsinkpad); gst_element_remove_pad (tee, srcpad); - - gst_object_unref (sinkpad); + gst_object_unref (srcpad); gst_object_unref (tee); + gst_element_set_state (sinkbin, GST_STATE_NULL); gst_bin_remove (GST_BIN (ctx->server_ctx->pipeline), sinkbin); gst_object_unref (sinkbin); gst_object_unref (ctx->appsink); @@ -88,7 +86,7 @@ pad_blocked_cleanup_cb (GstPad *srcpad, void stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx) { - GstPad *sinkpad, *srcpad; + GstPad *srcpad; TranscodeServerCtx *server_ctx = ctx->server_ctx; GstElement *sinkbin = GST_ELEMENT (gst_element_get_parent (ctx->appsink)); @@ -100,8 +98,7 @@ stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx) server_ctx->clients = g_list_remove (server_ctx->clients, ctx); /* Block sinkpad and srcpad, then unlink and remove */ - sinkpad = gst_element_get_static_pad (sinkbin, "qsink"); - srcpad = gst_pad_get_peer (sinkpad); + srcpad = gst_pad_get_peer (ctx->ghostsinkpad); gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK, (GstPadProbeCallback) pad_blocked_cleanup_cb, |