Browse Source

obs-ffmpeg: Fix compilation warnings on Clang and GCC

- Fix format warnings
- Fix unused-parameter warnings
tytan652 3 years ago
parent
commit
d473c9416f
2 changed files with 7 additions and 3 deletions
  1. 3 3
      plugins/obs-ffmpeg/obs-ffmpeg-rist.h
  2. 4 0
      plugins/obs-ffmpeg/obs-ffmpeg-srt.h

+ 3 - 3
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) /

+ 4 - 0
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",