From d473c9416f0a218463702c445067676b1b1e2d51 Mon Sep 17 00:00:00 2001 From: tytan652 Date: Sat, 30 Jul 2022 17:39:25 +0200 Subject: [PATCH] obs-ffmpeg: Fix compilation warnings on Clang and GCC - Fix format warnings - Fix unused-parameter warnings --- plugins/obs-ffmpeg/obs-ffmpeg-rist.h | 6 +++--- plugins/obs-ffmpeg/obs-ffmpeg-srt.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-rist.h b/plugins/obs-ffmpeg/obs-ffmpeg-rist.h index 41e8bd337..215f80ae1 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-rist.h +++ b/plugins/obs-ffmpeg/obs-ffmpeg-rist.h @@ -132,9 +132,9 @@ static int cb_stats(void *arg, const struct rist_stats *stats_container) blog(LOG_DEBUG, "[obs-ffmpeg mpegts muxer / librist]: Session Summary\n" "\tbandwidth [%.3f Mbps]\n" - "\tpackets sent [%lu]\n" - "\tpkts received [%lu]\n" - "\tpkts retransmitted [%lu]\n" + "\tpackets sent [%" PRIu64 "]\n" + "\tpkts received [%" PRIu64 "]\n" + "\tpkts retransmitted [%" PRIu64 "]\n" "\tquality (pkt sent over sent+retransmitted+skipped) [%.2f]\n" "\trtt [%" PRIu32 " ms]\n", (double)(stats_container->stats.sender_peer.bandwidth) / diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-srt.h b/plugins/obs-ffmpeg/obs-ffmpeg-srt.h index 2046d56c6..d4e73e56a 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-srt.h +++ b/plugins/obs-ffmpeg/obs-ffmpeg-srt.h @@ -104,6 +104,8 @@ static int libsrt_neterrno(URLContext *h) static int libsrt_getsockopt(URLContext *h, SRTSOCKET fd, SRT_SOCKOPT optname, const char *optnamestr, void *optval, int *optlen) { + UNUSED_PARAMETER(h); + if (srt_getsockopt(fd, 0, optname, optval, optlen) < 0) { blog(LOG_INFO, "[obs-ffmpeg mpegts muxer / libsrt]: Failed to get option %s on socket: %s", @@ -275,6 +277,8 @@ static int libsrt_setsockopt(URLContext *h, SRTSOCKET fd, SRT_SOCKOPT optname, const char *optnamestr, const void *optval, int optlen) { + UNUSED_PARAMETER(h); + if (srt_setsockopt(fd, 0, optname, optval, optlen) < 0) { blog(LOG_ERROR, "[obs-ffmpeg mpegts muxer / libsrt]: Failed to set option %s on socket: %s",