浏览代码

Fixed sfu-media example compilation

Paul-Louis Ageneau 4 年之前
父节点
当前提交
a4fe5cb874
共有 2 个文件被更改,包括 9 次插入5 次删除
  1. 8 4
      examples/client/getopt.cpp
  2. 1 1
      examples/sfu-media/main.cpp

+ 8 - 4
examples/client/getopt.cpp

@@ -35,7 +35,11 @@ PROFITS, BUSINESS INTERRUPTION, LOSS OF PROGRAMS OR OTHER DATA ON
 YOUR INFORMATION HANDLING SYSTEM OR OTHERWISE, EVEN If WE ARE
 YOUR INFORMATION HANDLING SYSTEM OR OTHERWISE, EVEN If WE ARE
 EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 */
 */
+
+#ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
+#endif
+
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <malloc.h>
 #include <malloc.h>
@@ -55,7 +59,7 @@ enum ENUM_ORDERING { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER };
 //
 //
 //
 //
 //		Ansi structures and functions follow
 //		Ansi structures and functions follow
-// 
+//
 //
 //
 
 
 static struct _getopt_data_a
 static struct _getopt_data_a
@@ -515,7 +519,7 @@ int _getopt_long_only_r_a (int argc, char *const *argv, const char *options, con
 //
 //
 //
 //
 //	Unicode Structures and Functions
 //	Unicode Structures and Functions
-// 
+//
 //
 //
 
 
 static struct _getopt_data_w
 static struct _getopt_data_w
@@ -690,7 +694,7 @@ int _getopt_internal_r_w (int argc, wchar_t *const *argv, const wchar_t *optstri
 			if (ambig_list != NULL && !exact)
 			if (ambig_list != NULL && !exact)
 			{
 			{
 				if (print_errors)
 				if (print_errors)
-				{						
+				{
 					struct option_list first;
 					struct option_list first;
 					first.p = pfound;
 					first.p = pfound;
 					first.next = ambig_list;
 					first.next = ambig_list;
@@ -970,4 +974,4 @@ int _getopt_long_r_w (int argc, wchar_t *const *argv, const wchar_t *options, co
 int _getopt_long_only_r_w (int argc, wchar_t *const *argv, const wchar_t *options, const struct option_w *long_options, int *opt_index, struct _getopt_data_w *d)
 int _getopt_long_only_r_w (int argc, wchar_t *const *argv, const wchar_t *options, const struct option_w *long_options, int *opt_index, struct _getopt_data_w *d)
 {
 {
 	return _getopt_internal_r_w (argc, argv, options, long_options, opt_index, 1, d, 0);
 	return _getopt_internal_r_w (argc, argv, options, long_options, opt_index, 1, d, 0);
-}
+}

+ 1 - 1
examples/sfu-media/main.cpp

@@ -65,7 +65,7 @@ int main() {
 		const rtc::SSRC targetSSRC = 4;
 		const rtc::SSRC targetSSRC = 4;
 
 
 		track->onMessage(
 		track->onMessage(
-		    [&receivers](rtc::binary message) {
+		    [&receivers, targetSSRC](rtc::binary message) {
 			    // This is an RTP packet
 			    // This is an RTP packet
 			    auto rtp = (rtc::RTP *)message.data();
 			    auto rtp = (rtc::RTP *)message.data();
 			    rtp->setSsrc(targetSSRC);
 			    rtp->setSsrc(targetSSRC);