mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
Check if return value of gst_rtsp_session_get_media is not NULL
This commit is contained in:
parent
b6e7986f45
commit
a76656ad8d
2 changed files with 24 additions and 1 deletions
|
@ -3,7 +3,7 @@ public_headers = \
|
|||
rtsp-client.h \
|
||||
rtsp-media.h \
|
||||
rtsp-session-pool.h \
|
||||
rtsp-session.h \
|
||||
rtsp-session.h
|
||||
|
||||
c_sources = \
|
||||
rtsp-server.c \
|
||||
|
|
|
@ -88,6 +88,8 @@ handle_teardown_response (GstRTSPClient *client, const gchar *uri, GstRTSPMessag
|
|||
|
||||
/* get a handle to the configuration of the media in the session */
|
||||
media = gst_rtsp_session_get_media (session, client->media);
|
||||
if (!media)
|
||||
goto not_found;
|
||||
|
||||
gst_rtsp_session_media_stop (media);
|
||||
|
||||
|
@ -116,6 +118,11 @@ service_unavailable:
|
|||
{
|
||||
return FALSE;
|
||||
}
|
||||
not_found:
|
||||
{
|
||||
handle_generic_response (client, GST_RTSP_STS_NOT_FOUND, request);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -139,6 +146,8 @@ handle_pause_response (GstRTSPClient *client, const gchar *uri, GstRTSPMessage *
|
|||
|
||||
/* get a handle to the configuration of the media in the session */
|
||||
media = gst_rtsp_session_get_media (session, client->media);
|
||||
if (!media)
|
||||
goto not_found;
|
||||
|
||||
gst_rtsp_session_media_pause (media);
|
||||
g_object_unref (session);
|
||||
|
@ -161,6 +170,11 @@ service_unavailable:
|
|||
{
|
||||
return FALSE;
|
||||
}
|
||||
not_found:
|
||||
{
|
||||
handle_generic_response (client, GST_RTSP_STS_NOT_FOUND, request);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -188,6 +202,8 @@ handle_play_response (GstRTSPClient *client, const gchar *uri, GstRTSPMessage *r
|
|||
|
||||
/* get a handle to the configuration of the media in the session */
|
||||
media = gst_rtsp_session_get_media (session, client->media);
|
||||
if (!media)
|
||||
goto not_found;
|
||||
|
||||
/* wait for paused to get the caps */
|
||||
ret = gst_rtsp_session_media_pause (media);
|
||||
|
@ -246,6 +262,11 @@ service_unavailable:
|
|||
handle_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, request);
|
||||
return FALSE;
|
||||
}
|
||||
not_found:
|
||||
{
|
||||
handle_generic_response (client, GST_RTSP_STS_NOT_FOUND, request);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -330,6 +351,8 @@ handle_setup_response (GstRTSPClient *client, const gchar *uri, GstRTSPMessage *
|
|||
|
||||
/* get a handle to the configuration of the media in the session */
|
||||
media = gst_rtsp_session_get_media (session, client->media);
|
||||
if (!media)
|
||||
goto not_found;
|
||||
|
||||
/* parse the stream we need to configure */
|
||||
if (!(pos = strstr (uri, "stream=")))
|
||||
|
|
Loading…
Reference in a new issue