media: emit the unprepared signal by id
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 21 Apr 2009 20:44:05 +0000 (22:44 +0200)
committerWim Taymans <wim@metal.(none)>
Tue, 21 Apr 2009 20:44:05 +0000 (22:44 +0200)
Emit the unprepared signal by id instead of name and set the media as
reused.

gst/rtsp-server/rtsp-media.c

index 482aaf1..e8bdaf2 100644 (file)
@@ -1158,9 +1158,13 @@ gst_rtsp_media_unprepare (GstRTSPMedia *media)
   g_message ("unprepare media %p", media);
   media->target_state = GST_STATE_NULL;
   gst_element_set_state (media->pipeline, GST_STATE_NULL);
+
   media->prepared = FALSE;
-  media->reused = FALSE;
-  g_signal_emit_by_name (media, "unprepared", NULL);
+  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 TRUE;
 }