From patchwork Sun Nov 15 18:20:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andriy Gelman X-Patchwork-Id: 23649 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 083A1449207 for ; Sun, 15 Nov 2020 20:20:46 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB52368B483; Sun, 15 Nov 2020 20:20:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1AA2B688154 for ; Sun, 15 Nov 2020 20:20:39 +0200 (EET) Received: by mail-qk1-f195.google.com with SMTP id q22so14558369qkq.6 for ; Sun, 15 Nov 2020 10:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/79FwKMZA91pelxPURZTq8sF2eStEC2IdfcyjGXtT1I=; b=YvQcbQigg7i4g8igjqSuXe1o+gUhi3IUWWRRgRv2Dz0kIin9FmAz0fSfnF98CPoMN9 KZlc1bUR0XFBE8EmadNMiGHXdWzvoJ9ZSu1/PvSEDU0k9y8SFYm8iojDYHK1FlaWBHSa uzIgRcdmSlVqdLn4L3q5woKmSSlRpaFnribiDZmgIp6n8tgpt2lHR965F4xb/LQCu4wy GKaeioATXWpGTFl5NEEgVr2HTzQB8u+xo4wxUAAQAT4OmdLQvSJ5nNe0i0p2Avzjpr9n 4yMpmFr25DwE0t/kCxa9ruVI9EVTh42JVZs52LsptFAD8JjS1A/z28/GXNMGWWO/x/Aq 6/KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/79FwKMZA91pelxPURZTq8sF2eStEC2IdfcyjGXtT1I=; b=MO7CYryqyFdZxSqJVhOdUNEnM18ILXmm05sv2POy+iR8didgP30lyrTUb6/kUOTTl6 sqEmtEXiLkBqPUEyame6/NAorB+wVsf68Qp0d1wiRlGKpnCzVAO6UfDXf2F7tEfFLwMA P+3RuEixWjfM8QxQfow502chImvru1hlRcKzFGW+Hafx4SbOnLTwilj/UC5OM0j3Cukt S7QRuHQceZRGpKznJZwf7/2eqiwjPgCefMlLSX0S8GvDNwf7GazNeziYyT+shH+x6iap oCgachLZwsxxeQT5tZY+u9jtK8Y1QcppMt5ZPjXF7pIM/P8Vgl6zRG8NuuxrszJgqnlQ ubhQ== X-Gm-Message-State: AOAM531A041G6IoYktnsPY0nE0ZSqAiI5gvzlnBSo7ZfNf53kfJkRUQ9 bpZLd/Ly8TaH4GoY0ZBdCMKp8lvKgG0= X-Google-Smtp-Source: ABdhPJwrGbWlax3n9I2UVT5y0bZVGw2rkWtoe1nNMhsZ124K9RyPj9proxozwiBGPnKKv7IUOSWwdg== X-Received: by 2002:a37:9481:: with SMTP id w123mr10822017qkd.3.1605464437742; Sun, 15 Nov 2020 10:20:37 -0800 (PST) Received: from localhost.localdomain (c-71-232-27-28.hsd1.ma.comcast.net. [71.232.27.28]) by smtp.gmail.com with ESMTPSA id g19sm9305178qkl.86.2020.11.15.10.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 10:20:37 -0800 (PST) From: Andriy Gelman X-Google-Original-From: Andriy Gelman To: ffmpeg-devel@ffmpeg.org Date: Sun, 15 Nov 2020 13:20:05 -0500 Message-Id: <20201115182005.24702-4-andriy.gelman@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201115182005.24702-1-andriy.gelman@gmail.com> References: <20201115182005.24702-1-andriy.gelman@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avformat/rtsp: change to default stimeout to 10 seconds 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 Cc: Andriy Gelman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Andriy Gelman This is to match the behaviour before commits: c8101aabee654f6d147a4d89f77fa73e18908610 92c40ef882be115e72d2aa02f9032b7ce88f8537 The only difference is that now a 10 second timeout will also be set when the rtsp session is being setup, whereas before this was an infinite timeout. Signed-off-by: Andriy Gelman --- doc/protocols.texi | 3 ++- libavformat/rtsp.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index fd866f57a5..0187da6c35 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1116,7 +1116,8 @@ which means an infinite timeout when @samp{listen} mode is set. Set number of packets to buffer for handling of reordered packets. @item stimeout -Set socket TCP I/O timeout in microseconds. +Set socket TCP I/O timeout in microseconds. Default is 10,000,000 microseconds +(10 seconds). @item user-agent This option is deprecated. Use @option{user_agent} instead. Override User-Agent header. If not specified, it defaults to the diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index a20cde80a9..3699d354f6 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -95,9 +95,9 @@ const AVOption ff_rtsp_options[] = { { "listen_timeout", "set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC }, #if FF_API_OLD_RTSP_OPTIONS { "timeout", "set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen) (deprecated, use listen_timeout)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC|AV_OPT_FLAG_DEPRECATED }, - { "stimeout", "set timeout (in microseconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT64, {.i64 = 0}, INT_MIN, INT64_MAX, DEC }, + { "stimeout", "set timeout (in microseconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT64, {.i64 = READ_PACKET_TIMEOUT_S*1000000}, INT_MIN, INT64_MAX, DEC }, #else - { "timeout", "set timeout (in microseconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT64, {.i64 = 0}, INT_MIN, INT64_MAX, DEC }, + { "timeout", "set timeout (in microseconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT64, {.i64 = READ_PACKET_TIMEOUT_S*1000000}, INT_MIN, INT64_MAX, DEC }, #endif COMMON_OPTS(), { "user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },