From e05dda70dde9823a60b6ead227c6db62c0f05f1b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 6 Sep 2014 12:59:26 -0700 Subject: rtmp2src: better cleanup --- plugins/gstrtmp2src.c | 15 ++++++++++++--- 1 file 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; } -- cgit v1.2.3