+ /* we need a new media configuration in this session */
+ sessmedia = NULL;
+ }
+
+ /* we have no session media, find one and manage it */
+ if (sessmedia == NULL) {
+ /* get a handle to the configuration of the media in the session */
+ media = find_media (client, state, &matched);
+ } else {
+ if ((media = gst_rtsp_session_media_get_media (sessmedia)))
+ g_object_ref (media);
+ }
+ /* no media, not found then */
+ if (media == NULL)
+ goto media_not_found;
+
+ /* path is what matched. We can modify the parsed uri in place */
+ path[matched] = '\0';
+ /* control is remainder */
+ control = &path[matched + 1];
+
+ /* find the stream now using the control part */
+ stream = gst_rtsp_media_find_stream (media, control);
+ if (stream == NULL)
+ goto stream_not_found;
+
+ /* now we have a uri identifying a valid media and stream */
+ state->stream = stream;
+ state->media = media;
+
+ if (session == NULL) {