summaryrefslogtreecommitdiffstats
path: root/gst/rtsp
diff options
context:
space:
mode:
authorJosep Torra <n770galaxy@gmail.com>2009-04-18 08:45:18 +0200
committerJosep Torra <n770galaxy@gmail.com>2009-04-18 08:50:46 +0200
commitec2d6053a0a6e8cf1b6822c4f26be61b2ac699be (patch)
treeadce0c10c82a586c5e4c52863df90451788e1bb3 /gst/rtsp
parentf9d7640bc971b7754d8ed8b187ec6db672c4ffdd (diff)
rtspsrc: map GST_RTSP_EEOF to EOS on server requests
Permit properly handle the EOS condition when server report it in a request.
Diffstat (limited to 'gst/rtsp')
-rw-r--r--gst/rtsp/gstrtspsrc.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 3cb2f9cc..f23ed542 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -2675,7 +2675,8 @@ gst_rtspsrc_handle_request (GstRTSPSrc * src, GstRTSPMessage * request)
res = gst_rtspsrc_connection_send (src, &response, NULL);
if (res < 0)
goto send_error;
- }
+ } else if (res == GST_RTSP_EEOF)
+ return res;
return GST_RTSP_OK;
@@ -2798,7 +2799,10 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
switch (message.type) {
case GST_RTSP_MESSAGE_REQUEST:
/* server sends us a request message, handle it */
- if ((res = gst_rtspsrc_handle_request (src, &message)) < 0)
+ res = gst_rtspsrc_handle_request (src, &message);
+ if (res == GST_RTSP_EEOF)
+ goto server_eof;
+ else if (res < 0)
goto handle_request_failed;
break;
case GST_RTSP_MESSAGE_RESPONSE:
@@ -3056,7 +3060,10 @@ gst_rtspsrc_loop_udp (GstRTSPSrc * src)
switch (message.type) {
case GST_RTSP_MESSAGE_REQUEST:
/* server sends us a request message, handle it */
- if ((res = gst_rtspsrc_handle_request (src, &message)) < 0)
+ res = gst_rtspsrc_handle_request (src, &message);
+ if (res == GST_RTSP_EEOF)
+ goto server_eof;
+ else if (res < 0)
goto handle_request_failed;
break;
case GST_RTSP_MESSAGE_RESPONSE:
@@ -3186,6 +3193,13 @@ play_failed:
GST_DEBUG_OBJECT (src, "play failed");
return GST_FLOW_OK;
}
+server_eof:
+ {
+ GST_DEBUG_OBJECT (src, "we got an eof from the server");
+ GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL),
+ ("The server closed the connection."));
+ return GST_FLOW_UNEXPECTED;
+ }
}
static void
@@ -3551,7 +3565,10 @@ next:
switch (response->type) {
case GST_RTSP_MESSAGE_REQUEST:
- if ((res = gst_rtspsrc_handle_request (src, response)) < 0)
+ res = gst_rtspsrc_handle_request (src, response);
+ if (res == GST_RTSP_EEOF)
+ goto server_eof;
+ else if (res < 0)
goto handle_request_failed;
goto next;
case GST_RTSP_MESSAGE_RESPONSE:
@@ -3633,6 +3650,13 @@ handle_request_failed:
/* ERROR was posted */
return res;
}
+server_eof:
+ {
+ GST_DEBUG_OBJECT (src, "we got an eof from the server");
+ GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL),
+ ("The server closed the connection."));
+ return GST_FLOW_UNEXPECTED;
+ }
}
/**