From patchwork Fri Apr 5 08:20:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 12618 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BB44A449664 for ; Fri, 5 Apr 2019 11:20:51 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 97E8268AB40; Fri, 5 Apr 2019 11:20:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CF3BE68AA9F for ; Fri, 5 Apr 2019 11:20:44 +0300 (EEST) Received: by mail-pl1-f173.google.com with SMTP id g12so2620392pll.11 for ; Fri, 05 Apr 2019 01:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=ENat0D+2z9S9MK1EdFpWoPNE3WIWYnHcCywiN0VGxcY=; b=qHWkyAwCr7eVWhSE/h+pth9bkILVGm4wAIibSTy7SdJvbpCrqC7hJhrNww/YVxdiID MDZgkMCfCXEr2YHRa3LlwvEZFJYeWj+S/O0dt0NUTzy+njnJgyN+RHmSoavcR33GHchU U4c4A6tLbq0728gSDqXwHf+swm3hHSFzHbHtqPceZ0/pJjW5R95XYAUOYTd8KeibDz3L DZhBWv6htPSYfTwOgtMUdChyc34ZU8YhhUbrDuNFBY44OZSKBwcBGLI7pimMevyVB8mu G0LUYwzFnw4wh/4RzpAu8CQYXpSldCtpHr6DbVNlClY1ZMvc0BvEvy505CFgyGQdSzwK jErw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=ENat0D+2z9S9MK1EdFpWoPNE3WIWYnHcCywiN0VGxcY=; b=lbkGaD5AqpVN9/hCwjoDIZ6k2S8K0YBxDBLK9d9Oe8MEsmYeZfsRUIV9tDbcieSr/1 cIk02+iwxPsq4Qw/mSZSmt1ir38oda5FOH/h5u2AdEF0Bsjo1SU3TRaAslkHOXWH+Y5B X7+9g2jeHK+XZRzoKPsoavlaKcuHjjLi7XOXgBT3f/UEJbtFlV2KArS49TzEqzyBPGGn 105E4rP012am/+42yOJWGMnsTwmeCO+SwqoM6V/pOHDmCvtN5oqhOGA8K4AhTywEZA3i QyqrfPOsGqxNXNVlHHUz/Rxe6D6tAKgk9aQylmqupZdXq7TXN4ud9JMkOvf27HNr3wpe VlSQ== X-Gm-Message-State: APjAAAWw0KQRQDV3dQKJ3CUOr69BDJZIgATfnobR7lneyD8NJE9sVlF4 ao7kX1dy80DJjqVeYY7mdsevEgq7 X-Google-Smtp-Source: APXvYqwy9wY3s89zOfiWC2P2vmLMloYccfOtwp8DPhOPjxW/qfhOdFtojRbb0m1aQKZOlfhqgKPUQg== X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr11027569plb.143.1554452442579; Fri, 05 Apr 2019 01:20:42 -0700 (PDT) Received: from jun-ubuntu.corp.microsoft.com ([2001:4898:80e8:a:c930:781d:ab74:81b9]) by smtp.googlemail.com with ESMTPSA id o5sm72068314pfa.135.2019.04.05.01.20.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 01:20:41 -0700 (PDT) From: Jun Li To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2019 01:20:31 -0700 Message-Id: <20190405082031.21235-1-junli1026@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH v1] lavf/rtsp.c: Fix stimeout option not applied on http tunnel X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" stimeout option is already used in tcp transport, since http is based on tcp, pass the option to http for tunneling case. --- libavformat/rtsp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 033095905d..2ca1aca94e 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1744,6 +1744,9 @@ redirect: char httpname[1024]; char sessioncookie[17]; char headers[1024]; + AVDictionary *options = NULL; + + av_dict_set_int(&options, "timeout", rt->stimeout, 0); ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" : "http", auth, host, port, "%s", path); snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x", @@ -1774,7 +1777,7 @@ redirect: } /* complete the connection */ - if (ffurl_connect(rt->rtsp_hd, NULL)) { + if (ffurl_connect(rt->rtsp_hd, &options)) { err = AVERROR(EIO); goto fail; } @@ -1818,10 +1821,11 @@ redirect: ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd); /* complete the connection */ - if (ffurl_connect(rt->rtsp_hd_out, NULL)) { + if (ffurl_connect(rt->rtsp_hd_out, &options)) { err = AVERROR(EIO); goto fail; } + av_dict_free(&options); } else { int ret; /* open the tcp connection */