mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
rtspsrc: avoid errors after server eof
Server eof (e.g. connection closed) is announced as connection closed, so better record state and act accordingly to prevent (read/write) errors during subsequent teardown/cleanup sequences. #Fixes 580851.(c).
This commit is contained in:
parent
734548a34f
commit
959a9b494b
1 changed files with 8 additions and 1 deletions
|
@ -2964,6 +2964,7 @@ 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."));
|
||||
src->connected = FALSE;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
}
|
||||
interrupt:
|
||||
|
@ -3209,6 +3210,7 @@ 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."));
|
||||
src->connected = FALSE;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
}
|
||||
}
|
||||
|
@ -4717,7 +4719,12 @@ gst_rtspsrc_close (GstRTSPSrc * src)
|
|||
GST_DEBUG_OBJECT (src, "stop connection flush");
|
||||
gst_rtsp_connection_flush (src->connection, FALSE);
|
||||
|
||||
if (src->methods & (GST_RTSP_PLAY | GST_RTSP_TEARDOWN) && src->connected) {
|
||||
if (!src->connected) {
|
||||
GST_DEBUG_OBJECT (src, "not connected, doing cleanup");
|
||||
goto close;
|
||||
}
|
||||
|
||||
if (src->methods & (GST_RTSP_PLAY | GST_RTSP_TEARDOWN)) {
|
||||
/* do TEARDOWN */
|
||||
res =
|
||||
gst_rtsp_message_init_request (&request, GST_RTSP_TEARDOWN,
|
||||
|
|
Loading…
Reference in a new issue