summaryrefslogtreecommitdiff
path: root/src/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib.c b/src/lib.c
index b22e82f..f527e04 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -59,6 +59,15 @@ stp_on_gst_bus_message (GstBus *bus,
return TRUE;
}
+gboolean stp_unref_gst_buffer (GstBuffer **buffer,
+ guint idx,
+ gpointer user_data)
+{
+ gst_buffer_unref (*buffer);
+ *buffer = NULL;
+ return TRUE;
+}
+
/* When the incoming stream reaches EOS, we call this
* which initiates a shutdown for all clients and then
* the server itself */
@@ -75,6 +84,9 @@ stp_cleanup_transcode_server_ctx (TranscodeServerCtx *ctx)
gst_element_set_state (ctx->pipeline, GST_STATE_NULL);
gst_object_unref (ctx->pipeline);
+ gst_buffer_list_foreach (ctx->keyframe, stp_unref_gst_buffer, NULL);
+ gst_buffer_list_unref (ctx->keyframe);
+
g_free (ctx);
}
@@ -100,7 +112,6 @@ pad_blocked_cleanup_cb (GstPad *srcpad,
gst_bin_remove (GST_BIN (ctx->server_ctx->pipeline), sinkbin);
gst_object_unref (sinkbin);
- g_mutex_clear (&ctx->can_write_chunk);
stp_print_status (" Client cleanup done!\n");
return GST_PAD_PROBE_OK;
}
@@ -128,6 +139,8 @@ stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx)
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK,
(GstPadProbeCallback) pad_blocked_cleanup_cb,
ctx, (GDestroyNotify)g_free);
+
+ g_mutex_clear (&ctx->can_write_chunk);
gst_object_unref (sinkbin);
stp_print_status (".");
}