diff options
| author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-04-30 10:24:27 +0200 | 
|---|---|---|
| committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-05-04 17:01:35 +0200 | 
| commit | 959a9b494b7eb2d5ea02bae722339c75a93d7e1e (patch) | |
| tree | beda1ad712a88ee777c65b73b8378609f0a36aaf | |
| parent | 734548a34fbb6679dc6b7c568b2cceb2a903a2dc (diff) | |
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).
| -rw-r--r-- | gst/rtsp/gstrtspsrc.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index b80ecead..3d572863 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -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,  | 
