[FFmpeg-cvslog] libavformat/rtsp.c: Reply to GET_PARAMETER requests

Hayden Myers git at videolan.org
Mon Jul 12 16:20:31 EEST 2021

ffmpeg | branch: master | Hayden Myers <hmyers at skylinenet.net> | Mon Jul 12 16:00:34 2021 +0300| [9b4b0df47009ebc3d26bf3f1b1eff668fd028cc6] | committer: Martin Storsjö

libavformat/rtsp.c: Reply to GET_PARAMETER requests

Some encoders send GET_PARAMETER requests as a keep-alive mechanism.
If the client doesn't reply with an OK message, the encoder will close
the session.  This was encountered with the impath i5110 encoder, when
the RTSP Keep-Alive checkbox is enabled under streaming settings.
Alternatively one may set the X-No-Keepalive: 1 header, but this is more
of a workaround.  It's better practice to respond to an encoder's
keep-alive request, than disable the mechanism which may be manufacturer

Signed-off-by: Hayden Myers <hmyers at skylinenet.net>
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b4b0df47009ebc3d26bf3f1b1eff668fd028cc6

 libavformat/rtsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 972cab57d7..9869e1b72e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1259,7 +1259,8 @@ start:
         char base64buf[AV_BASE64_SIZE(sizeof(buf))];
         const char* ptr = buf;
-        if (!strcmp(reply->reason, "OPTIONS")) {
+        if (!strcmp(reply->reason, "OPTIONS") ||
+            !strcmp(reply->reason, "GET_PARAMETER")) {
             snprintf(buf, sizeof(buf), "RTSP/1.0 200 OK\r\n");
             if (reply->seq)
                 av_strlcatf(buf, sizeof(buf), "CSeq: %d\r\n", reply->seq);

More information about the ffmpeg-cvslog mailing list