[vlc-commits] 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 git at videolan.org
Sat Nov 10 21:43:01 CET 2012


vlc/vlc-2.0 | branch: master | Daniel Peng <dpeng at google.com> | Thu Sep 13 23:49:38 2012 -0400| [7f12d46095d394e969c422fdcb95abadc5ff0c49] | committer: Jean-Baptiste Kempf

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.

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?  :)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 31180356048402d449f4ee765da20e67ff7e8005)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=7f12d46095d394e969c422fdcb95abadc5ff0c49
---

 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 0c24344..e75b2fb 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -532,17 +532,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;
 }
 



More information about the vlc-commits mailing list