[vlc-devel] [PATCH] 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
Fri Sep 14 05:49:38 CEST 2012


I have a Foscam h.264 IP camera with a very strange RTSP-over-HTTP 
server, and I wanted to get VLC to play it back.  Here's the patch 
to VLC; I also had a patch committed to live555 to resolve a few 
other issues, and that's available in live.2012.09.13.tar.gz.  Do I 
need to submit a patch to contrib/src/live555/rules.mak to pick that 
new version up?  Or is there a special process for that?  Or should 
I just wait a little bit?  :)

---
 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