summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2014-09-06 12:59:26 -0700
committerDavid Schleef <ds@schleef.org>2014-09-06 12:59:26 -0700
commite05dda70dde9823a60b6ead227c6db62c0f05f1b (patch)
tree1fe4069b49cfa83df23bb3bf443e862f5a3c73f7
parent8f0c03872294068de6e15adb5ab0ac65e99db398 (diff)
rtmp2src: better cleanup
-rw-r--r--plugins/gstrtmp2src.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/gstrtmp2src.c b/plugins/gstrtmp2src.c
index 22f376b..26cfd31 100644
--- a/plugins/gstrtmp2src.c
+++ b/plugins/gstrtmp2src.c
@@ -386,6 +386,12 @@ gst_rtmp2_src_task (gpointer user_data)
g_main_loop_run (main_loop);
rtmp2src->task_main_loop = NULL;
g_main_loop_unref (main_loop);
+
+ while (g_main_context_pending (main_context)) {
+ GST_ERROR ("iterating main context to clean up");
+ g_main_context_iteration (main_context, FALSE);
+ }
+
g_main_context_unref (main_context);
GST_DEBUG ("gst_rtmp2_src_task exiting");
@@ -581,6 +587,12 @@ gst_rtmp2_src_stop (GstBaseSrc * src)
GST_DEBUG_OBJECT (rtmp2src, "stop");
+ gst_rtmp_connection_close (rtmp2src->connection);
+
+ gst_task_stop (rtmp2src->task);
+ g_main_loop_quit (rtmp2src->task_main_loop);
+
+ gst_task_join (rtmp2src->task);
return TRUE;
}
@@ -668,9 +680,6 @@ gst_rtmp2_src_unlock_stop (GstBaseSrc * src)
GST_DEBUG_OBJECT (rtmp2src, "unlock_stop");
- gst_task_stop (rtmp2src->task);
- g_main_loop_quit (rtmp2src->task_main_loop);
-
return TRUE;
}