rtsp: Only do keepalive using GET_PARAMETER if the server supports it
[ffmpeg.git] / libavformat / rtspdec.c
index 866f313d106bbcda738873e9c547df200b5dfe69..ccfc4d8e279034f8ba12b7316be4688d57aaf076 100644 (file)
@@ -341,7 +341,9 @@ retry:
 
     /* send dummy request to keep TCP connection alive */
     if ((av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2) {
-        if (rt->server_type != RTSP_SERVER_REAL) {
+        if (rt->server_type == RTSP_SERVER_WMS ||
+           (rt->server_type != RTSP_SERVER_REAL &&
+            rt->get_parameter_supported)) {
             ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL);
         } else {
             ff_rtsp_send_cmd_async(s, "OPTIONS", "*", NULL);