From patchwork Fri Apr 5 18:50:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 12620 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 3707C449769 for ; Fri, 5 Apr 2019 21:50:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 169D568A96E; Fri, 5 Apr 2019 21:50:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 567B068A953 for ; Fri, 5 Apr 2019 21:50:49 +0300 (EEST) Received: by mail-pf1-f175.google.com with SMTP id c207so3752915pfc.7 for ; Fri, 05 Apr 2019 11:50:49 -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=Ia56II7WFol3EQ00ky68CUftRLYzUgnO90d7tMNYW/c=; b=LbURn1WsdXcU2VTnNmQPRTu+NrDUBzPkQRRPm2pjDiMfCzAAJRmQpMd/CtBwKte4qw iBrGATzt+I5i3uL6wRSsfPwmPVtrlNveX3zl1JJQvov+ljeCrLwRdu94pP+Sz3XvzDrv SpU84kqJFndgnsbRCIK0gao9uiAZCL7hXM/ZoqmPpgajVsompGrsSsRuFMMz6QlPnisn kmpn53yK89NVRKQsVvM/ph6pYe6ER6UftlLdcd4/pgDRTS5j09mr7jBVf7SFql+AZzD+ ruJ1/5TlPqIhOzsEYu7uIuKpz3ancYUVmdE0PB9wCmX3wufHFj984AnPzUI8VL4E9bP0 TJWQ== 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=Ia56II7WFol3EQ00ky68CUftRLYzUgnO90d7tMNYW/c=; b=dFcu9zLdMuX7kLgP5zfjIclXe30whkW/Vhih67e8eiktVeJSuvBYgKBrCr+snLh1yV NshPNkwgC8aC+N/abGKN+PMiSR7jaiFFTiVFmO1I/ufF4q2AZ/MBHAKV2mp/+P6bpS9E +k4u9GBYWX7705gl+QYDNKekprhN56rKiSSsPDEFu8TDJk/ROz0FykyF/ODFNLD1baf1 +w8P5SZC7VNJ5iszv3bHv9/dnfs/qnw7F9/0yKYAoUKHfBjfr+nJAA+3FG+tA6Z2Ln0a 8thgy/Gi74AyEHjha5eSpt212MgwF9CoLJX3TuFPWuJ/e0CZt0qzjiGcgsSsA0JtxIWC Ez9g== X-Gm-Message-State: APjAAAUnkQ3uPDq3jhUmo7V+qfLc1TMKZhAjhkU+oIncmWGvwztFyWMb xN8mZgRgvchIpr/kCFEH13eiS5OD X-Google-Smtp-Source: APXvYqwAUcQCtDvduGFYCvRPqP72mgY75CEGc8LaDNa4bQr/uDcZsAiRU8EDZg8lF9lZZboQG8O36Q== X-Received: by 2002:a62:2fc7:: with SMTP id v190mr12610227pfv.10.1554490246893; Fri, 05 Apr 2019 11:50:46 -0700 (PDT) Received: from jun-ubuntu.corp.microsoft.com ([131.107.147.217]) by smtp.googlemail.com with ESMTPSA id n21sm25619374pfb.42.2019.04.05.11.50.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 11:50:45 -0700 (PDT) From: Jun Li To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2019 11:50:40 -0700 Message-Id: <20190405185040.12501-1-junli1026@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH v2] 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 033095905d..8349840c96 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,8 @@ redirect: } /* complete the connection */ - if (ffurl_connect(rt->rtsp_hd, NULL)) { + if (ffurl_connect(rt->rtsp_hd, &options)) { + av_dict_free(&options); err = AVERROR(EIO); goto fail; } @@ -1818,10 +1822,12 @@ 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)) { + av_dict_free(&options); err = AVERROR(EIO); goto fail; } + av_dict_free(&options); } else { int ret; /* open the tcp connection */