media: signal unprepared when we actually finish
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 26 Oct 2012 13:21:50 +0000 (15:21 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 26 Oct 2012 13:21:50 +0000 (15:21 +0200)
gst/rtsp-server/rtsp-media.c

index bce78d5..1f216e8 100644 (file)
@@ -1287,12 +1287,6 @@ gst_rtsp_media_unprepare (GstRTSPMedia * media)
     finish_unprepare (media);
   }
 
-  media->reused = TRUE;
-
-  /* when the media is not reusable, this will effectively unref the media and
-   * recreate it */
-  g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_UNPREPARED], 0, NULL);
-
   return success;
 }
 
@@ -1323,7 +1317,12 @@ finish_unprepare (GstRTSPMedia * media)
   gst_object_unref (media->pipeline);
   media->pipeline = NULL;
 
+  media->reused = TRUE;
   media->status = GST_RTSP_MEDIA_STATUS_UNPREPARED;
+
+  /* when the media is not reusable, this will effectively unref the media and
+   * recreate it */
+  g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_UNPREPARED], 0, NULL);
 }
 
 static gboolean