[vlc-devel] [PATCH 1/2] Some RTSP implementations (Foscam H.264 IP cameras) return HTTP/1.1 501 Unimplemented on OPTIONS requests. Don't fail out in this case; just continue and assume GET_PARAMETERS is unsupported.

Daniel Peng dpeng at google.com
Sat Sep 15 06:58:08 CEST 2012


---
 modules/demux/live555.cpp |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 93433a7..a469d3c 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -533,17 +533,14 @@ static void continueAfterOPTIONS( RTSPClient* client, int result_code,
 {
     RTSPClientVlc *client_vlc = static_cast<RTSPClientVlc *> (client);
     demux_sys_t *p_sys = client_vlc->p_sys;
-    p_sys->i_live555_ret = result_code;
-    if ( result_code != 0 )
-    {
-        p_sys->b_error = true;
-        p_sys->event_rtsp = 1;
-    }
-    else
-    {
-        p_sys->b_get_param = result_string != NULL && strstr( result_string, "GET_PARAMETER" ) != NULL;
-        client->sendDescribeCommand( continueAfterDESCRIBE );
-    }
+    p_sys->b_get_param =
+      // If OPTIONS fails, assume GET_PARAMETER is not supported but
+      // still continue on with the stream.  Some servers (foscam)
+      // return 501/not implemented for OPTIONS.
+      result_code != 0
+      && result_string != NULL
+      && strstr( result_string, "GET_PARAMETER" ) != NULL;
+    client->sendDescribeCommand( continueAfterDESCRIBE );
     delete[] result_string;
 }
 
-- 
1.7.9.5




More information about the vlc-devel mailing list