these cameras return `Transport: RTP/AVP` for a SETUP request of
RTP/AVP/TCP, yet they only use TCP transport.

`make check` still passes after patch.
-- 
John Comeau KE5TFZ j...@unternet.net http://jc.unternet.net/
"A place for everything, and everything all over the place"
diff --git a/TODO.txt b/TODO.txt
new file mode 100644
index 0000000000..1b0c64c186
--- /dev/null
+++ b/TODO.txt
@@ -0,0 +1 @@
+2016-12-06: Fix assembly for NASM. See http://stackoverflow.com/questions/36854583/compiling-ffmpeg-for-kali-linux-2
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6292c5543..fac625a121 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1554,6 +1554,20 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             goto fail;
         }
 
+        /* If the server responded with another lower transport mode
+         * than what we requested, complain but attempt to continue.
+         * Cheap IP cameras like Sricam SP005, for example, respond with
+         * `Transport: RTP/AVP` for a SETUP request of RTP/AVP/TCP
+         * yet is sending over TCP anyway */
+        if (reply->transports[0].lower_transport != lower_transport) {
+            av_log(s, AV_LOG_ERROR, "Nonmatching transport in server reply\n");
+            av_log(s, AV_LOG_DEBUG, "We asked for %d and got %d\n",
+                   lower_transport,
+                   reply->transports[0].lower_transport);
+            av_log(s, AV_LOG_DEBUG, "Mask is %d\n", rt->lower_transport_mask);
+            reply->transports[0].lower_transport = lower_transport;
+        }
+
         /* XXX: same protocol for all streams is required */
         if (i > 0) {
             if (reply->transports[0].lower_transport != rt->lower_transport ||
@@ -1566,14 +1580,6 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             rt->transport = reply->transports[0].transport;
         }
 
-        /* Fail if the server responded with another lower transport mode
-         * than what we requested. */
-        if (reply->transports[0].lower_transport != lower_transport) {
-            av_log(s, AV_LOG_ERROR, "Nonmatching transport in server reply\n");
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
         switch(reply->transports[0].lower_transport) {
         case RTSP_LOWER_TRANSPORT_TCP:
             rtsp_st->interleaved_min = reply->transports[0].interleaved_min;
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to