diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index c8817eb67..557de4bb3 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -214,15 +214,16 @@ function OSX_prepare() fi OS_IS_OSX=YES - echo "OSX detected, install tools if needed" # requires the osx when os if [ $OS_IS_OSX = YES ]; then if [ $SRS_OSX = NO ]; then - echo "OSX detected, must specifies the --osx" + echo "OSX detected, please use: ./configure --osx" exit 1 fi fi + echo "OSX detected, install tools if needed" + brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then echo "install brew" echo "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"" diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index 42f448724..218e6b6d5 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -460,10 +460,10 @@ srs_error_t SrsDtlsSession::unprotect_rtcp(char* out_buf, const char* in_buf, in return srs_error_new(ERROR_RTC_SRTP_UNPROTECT, "rtcp unprotect failed"); } -SrsRtcPackets::SrsRtcPackets(bool gso, bool merge_nalus) +SrsRtcPackets::SrsRtcPackets() { - use_gso = gso; - should_merge_nalus = merge_nalus; + use_gso = false; + should_merge_nalus = false; nn_rtp_pkts = 0; nn_audios = nn_extras = 0; @@ -473,6 +473,14 @@ SrsRtcPackets::SrsRtcPackets(bool gso, bool merge_nalus) SrsRtcPackets::~SrsRtcPackets() { + reset(use_gso, should_merge_nalus); +} + +void SrsRtcPackets::reset(bool gso, bool merge_nalus) +{ + use_gso = gso; + should_merge_nalus = merge_nalus; + vector::iterator it; for (it = packets.begin(); it != packets.end(); ++it ) { SrsRtpPacket2* packet = *it; @@ -621,6 +629,7 @@ srs_error_t SrsRtcSenderThread::cycle() bool realtime = _srs_config->get_realtime_enabled(req->vhost, true); srs_utime_t mw_sleep = _srs_config->get_mw_sleep(req->vhost, true); + SrsRtcPackets pkts; SrsMessageArray msgs(SRS_PERF_MW_MSGS); SrsPithyPrint* pprint = SrsPithyPrint::create_rtc_play(); @@ -656,11 +665,14 @@ srs_error_t SrsRtcSenderThread::cycle() continue; } - SrsRtcPackets pkts(gso, merge_nalus); + // Transmux and send out messages. + pkts.reset(gso, merge_nalus); + if ((err = send_messages(sendonly_ukt, source, msgs.msgs, msg_count, pkts)) != srs_success) { srs_warn("send err %s", srs_error_summary(err).c_str()); srs_error_reset(err); } + // Do cleanup messages. for (int i = 0; i < msg_count; i++) { SrsSharedPtrMessage* msg = msgs.msgs[i]; srs_freep(msg); diff --git a/trunk/src/app/srs_app_rtc_conn.hpp b/trunk/src/app/srs_app_rtc_conn.hpp index 978681ccb..c2edcd625 100644 --- a/trunk/src/app/srs_app_rtc_conn.hpp +++ b/trunk/src/app/srs_app_rtc_conn.hpp @@ -143,8 +143,10 @@ public: public: std::vector packets; public: - SrsRtcPackets(bool gso, bool merge_nalus); + SrsRtcPackets(); virtual ~SrsRtcPackets(); +public: + void reset(bool gso, bool merge_nalus); }; class SrsRtcSenderThread : virtual public ISrsCoroutineHandler, virtual public ISrsReloadHandler