diff mbox series

[FFmpeg-devel,1/2] avformat/libsrt: add LIBSRT_SETSOCKOPT/GETSOCKOPT helper

Message ID tencent_7FC569BE7FDAAF263A31C0DDB41C6B0A000A@qq.com
State New
Headers show
Series [FFmpeg-devel,1/2] avformat/libsrt: add LIBSRT_SETSOCKOPT/GETSOCKOPT helper
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Zhao Zhili Feb. 7, 2021, 11:46 a.m. UTC
To avoid duplicate between optname and optnamestr.
---
 libavformat/libsrt.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

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.