From patchwork Sun Feb 7 11:46:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 25477 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 AAA9044B0DA for ; Sun, 7 Feb 2021 13:46:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D1F8687F4E; Sun, 7 Feb 2021 13:46:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from qq.com (out203-205-251-73.mail.qq.com [203.205.251.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3D6D5687F4E for ; Sun, 7 Feb 2021 13:46:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1612698378; bh=+PIT+w83RSkoygYWBLIOzGrOlWtabH5XjvXLgUuUDlM=; h=From:To:Cc:Subject:Date; b=DKOOJ6UsbUEYEVs9y94ENcUb3M63yl07cLFmtdE3S7R+K/T1f05cnH7RiVkV2yiaO D8PRZto+AAqDanH7jqg7oSvL31I2gcT3a9zl+7J0PQFPH+KTtIhPijXDNAB+FGPkmp 4IA8MAF9fPeWuNPB+xuLCDEedYlZpyI1AMhlGbos= Received: from ZHILIZHAO-MB2.tencent.com ([59.37.125.48]) by newxmesmtplogicsvrsza9.qq.com (NewEsmtp) with SMTP id B8E2C6F9; Sun, 07 Feb 2021 19:46:14 +0800 X-QQ-mid: xmsmtpt1612698374tekrkuybr Message-ID: X-QQ-XMAILINFO: NAQCntfS4znsxR9dDTpYhJjYcxwQrv31L8HcT0pWY8m8ObSgcZ0vmCpZgg1FDj 2ndGgUoDS9VE26yFMYMPYcY3t2dJvA5H+O9VFxLUO1nru3G+DtV8aSjmjN31L/TUFjCf4Y0pW2ks MWgLH+gGCOiXOd3z/9JszYImDR6/PbyBx3ipz1dLfhoCqtJYDGnKE2/F8ZeaRlsu0+FVh81u/KZ6 ho22bIqHGvx+Gc0F1GKtxbCkn6qOiLqciSB0fFDpwl7bA3RrkC7sOkxiSvngd1JhPZ38+Zim6Mfe wJ7lyj0uCLW1ulDhZ5S1Q4SAWiSQM0Fifi4k3S22RAD0QSJP92L6jI/nIX7oFVrdmX34MqVMCxSz joQuingVkvqfVvako6svwuASmeDtBieQ2h7tDkXHU30E03arpNBHEJF21Y6vNOL+CQyLXR1fE4bc CSbA8KlGoz7EkmS//RdaPTxw7jd88xHlJBm+Zcoh5M02U22B0cPbqKgtl1XIWFQGZO4v9kpZ3EIq 8Br0Xe63PHu19OF1cxto+5ENZuKPDHegvn8betfrUkTcpDzW5Sj+OqqzCoonvUiyqZWQwPGlFaHw d7YzFxdRj/XFjqZMuS4qEHTTAC8uLex9iL19p5azQ04+xaHtp4ibSFCpVz91F3XiYGAIXbHDAIca ZlSXgRgXPjASZ87WeWQAxx3pT3tyFCLLju1l+Ar2GsNitJj9U1Hub7oVFDTmdx//Jeza0CUazpSY 7k2ohiASfAlbShiJlCETHlF/vkCGut2XEMrNwySJkrYb7mNajefR3keC8/DHOFcvpbxUP5k8k2pv UXnZvfy/dGgkbLV1/B6Azb From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 Feb 2021 19:46:11 +0800 X-OQ-MSGID: <20210207114612.38865-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/libsrt: add LIBSRT_SETSOCKOPT/GETSOCKOPT helper 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" To avoid duplicate between optname and optnamestr. --- libavformat/libsrt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c index f73e7dbfa5..557ab9e6e3 100644 --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -272,6 +272,9 @@ static int libsrt_setsockopt(URLContext *h, int fd, SRT_SOCKOPT optname, const c return 0; } +#define LIBSRT_SETSOCKOPT(h, fd, optname, optval, optlen) \ + libsrt_setsockopt((h), (fd), (optname), AV_TOSTRING(optname), (optval), (optlen)) + static int libsrt_getsockopt(URLContext *h, int fd, SRT_SOCKOPT optname, const char * optnamestr, void * optval, int * optlen) { if (srt_getsockopt(fd, 0, optname, optval, optlen) < 0) { @@ -281,6 +284,9 @@ static int libsrt_getsockopt(URLContext *h, int fd, SRT_SOCKOPT optname, const c return 0; } +#define LIBSRT_GETSOCKOPT(h, fd, optname, optval, optlen) \ + libsrt_getsockopt((h), (fd), (optname), AV_TOSTRING(optname), (optval), (optlen)) + /* - The "POST" options can be altered any time on a connected socket. They MAY have also some meaning when set prior to connecting; such option is SRTO_RCVSYN, which makes connect/accept call asynchronous.