rtsp: Use GET_PARAMETER for keep-alive for generic RTSP servers

Message ID 1301517328-83345-1-git-send-email-martin@martin.st
State Committed
Commit 229e2631be528c595650a7568c1d4df8af9c4944
Headers show

Commit Message

Martin Storsjö March 30, 2011, 8:35 p.m.
According to the RFC, GET_PARAMETER should be used for
this, and according to a report from Tim Ouellette,
OPTIONS doesn't work for keeping the connection alive for some
servers. Also, live555 uses GET_PARAMETER for this purpose.
---
 libavformat/rtspdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Luca Barbato March 30, 2011, 8:38 p.m. | #1
On 03/30/2011 10:35 PM, Martin Storsjö wrote:
> According to the RFC, GET_PARAMETER should be used for
> this, and according to a report from Tim Ouellette,
> OPTIONS doesn't work for keeping the connection alive for some
> servers. Also, live555 uses GET_PARAMETER for this purpose.

I do hope there aren't other servers complaining. Patch ok for now.

lu

Patch

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 571e76d..e2ba76e 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -340,7 +340,7 @@  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_WMS) {
+        if (rt->server_type != RTSP_SERVER_REAL) {
             ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL);
         } else {
             ff_rtsp_send_cmd_async(s, "OPTIONS", "*", NULL);