media: stop the thread in more error cases

This commit is contained in:
Ognyan Tonchev 2014-04-12 05:57:00 +02:00 committed by Wim Taymans
parent de2a70bb10
commit da19a3c21a
2 changed files with 12 additions and 1 deletions

View file

@ -2258,6 +2258,9 @@ was_prepared:
/* ERRORS */ /* ERRORS */
not_unprepared: not_unprepared:
{ {
/* we are not going to use the giving thread, so stop it. */
if (thread)
gst_rtsp_thread_stop (thread);
GST_WARNING ("media %p was not unprepared", media); GST_WARNING ("media %p was not unprepared", media);
priv->prepare_count--; priv->prepare_count--;
g_rec_mutex_unlock (&priv->state_lock); g_rec_mutex_unlock (&priv->state_lock);
@ -2265,6 +2268,9 @@ not_unprepared:
} }
is_reused: is_reused:
{ {
/* we are not going to use the giving thread, so stop it. */
if (thread)
gst_rtsp_thread_stop (thread);
priv->prepare_count--; priv->prepare_count--;
g_rec_mutex_unlock (&priv->state_lock); g_rec_mutex_unlock (&priv->state_lock);
GST_WARNING ("can not reuse media %p", media); GST_WARNING ("can not reuse media %p", media);
@ -2272,6 +2278,9 @@ is_reused:
} }
no_create_rtpbin: no_create_rtpbin:
{ {
/* we are not going to use the giving thread, so stop it. */
if (thread)
gst_rtsp_thread_stop (thread);
priv->prepare_count--; priv->prepare_count--;
g_rec_mutex_unlock (&priv->state_lock); g_rec_mutex_unlock (&priv->state_lock);
GST_ERROR ("no create_rtpbin function"); GST_ERROR ("no create_rtpbin function");
@ -2280,6 +2289,9 @@ no_create_rtpbin:
} }
no_rtpbin: no_rtpbin:
{ {
/* we are not going to use the giving thread, so stop it. */
if (thread)
gst_rtsp_thread_stop (thread);
priv->prepare_count--; priv->prepare_count--;
g_rec_mutex_unlock (&priv->state_lock); g_rec_mutex_unlock (&priv->state_lock);
GST_WARNING ("no rtpbin element"); GST_WARNING ("no rtpbin element");

View file

@ -205,7 +205,6 @@ GST_START_TEST (test_media_prepare)
"( videotestsrc is-live=true ! rtpvrawpay pt=96 name=pay0 )"); "( videotestsrc is-live=true ! rtpvrawpay pt=96 name=pay0 )");
g_object_unref (pool); g_object_unref (pool);
gst_rtsp_thread_stop (thread);
gst_rtsp_thread_pool_cleanup (); gst_rtsp_thread_pool_cleanup ();
} }