changeset 6410:31aef55204bd libavformat

rtsp: Return EOF if the TCP control channel is closed
author mstorsjo
date Wed, 25 Aug 2010 13:42:17 +0000
parents fe8fadaf5fb6
children f0669792a6bd
files rtsp.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rtsp.c	Wed Aug 25 13:31:33 2010 +0000
+++ b/rtsp.c	Wed Aug 25 13:42:17 2010 +0000
@@ -797,7 +797,7 @@
             dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
 #endif
             if (ret != 1)
-                return -1;
+                return AVERROR_EOF;
             if (ch == '\n')
                 break;
             if (ch == '$') {
@@ -1719,8 +1719,8 @@
         RTSPMessageHeader reply;
 
         ret = ff_rtsp_read_reply(s, &reply, NULL, 1);
-        if (ret == -1)
-            return -1;
+        if (ret < 0)
+            return ret;
         if (ret == 1) /* received '$' */
             break;
         /* XXX: parse message */