diff --git a/trunk/3rdparty/tools/build_ccache.sh b/trunk/3rdparty/tools/build_ccache.sh new file mode 100644 index 000000000..53b187882 --- /dev/null +++ b/trunk/3rdparty/tools/build_ccache.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# check exists. +if [[ -f /usr/local/bin/ccache ]]; then + echo "ccache is ok"; + exit 0; +fi + +# check sudoer. +sudo echo "ok" > /dev/null 2>&1; +ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi + +unzip ccache-3.1.9.zip && cd ccache-3.1.9 && ./configure && make +ret=$?; if [[ $ret -ne 0 ]]; then echo "build ccache failed."; exit $ret; fi + +sudo cp ccache /usr/local/bin && sudo ln -s ccache /usr/local/bin/gcc && sudo ln -s ccache /usr/local/bin/g++ && sudo ln -s ccache /usr/local/bin/cc && sudo ln -s ccache /usr/local/bin/c++ +ret=$?; if [[ $ret -ne 0 ]]; then echo "install ccache failed."; exit $ret; fi diff --git a/trunk/3rdparty/tools/ccache-3.1.9.zip b/trunk/3rdparty/tools/ccache-3.1.9.zip new file mode 100644 index 000000000..ae5f43e83 Binary files /dev/null and b/trunk/3rdparty/tools/ccache-3.1.9.zip differ diff --git a/trunk/src/core/srs_core_source.cpp b/trunk/src/core/srs_core_source.cpp index 9137db919..4024e5a18 100644 --- a/trunk/src/core/srs_core_source.cpp +++ b/trunk/src/core/srs_core_source.cpp @@ -364,12 +364,23 @@ SrsSource::SrsSource(std::string _stream_url) SrsSource::~SrsSource() { - std::vector::iterator it; - for (it = consumers.begin(); it != consumers.end(); ++it) { - SrsConsumer* consumer = *it; - srs_freep(consumer); + if (true) { + std::vector::iterator it; + for (it = consumers.begin(); it != consumers.end(); ++it) { + SrsConsumer* consumer = *it; + srs_freep(consumer); + } + consumers.clear(); + } + + if (true) { + std::vector::iterator it; + for (it = forwarders.begin(); it != forwarders.end(); ++it) { + SrsForwarder* forwarder = *it; + srs_freep(forwarder); + } + forwarders.clear(); } - consumers.clear(); srs_freep(cache_metadata); srs_freep(cache_sh_video); diff --git a/trunk/src/core/srs_core_source.hpp b/trunk/src/core/srs_core_source.hpp index 14cfd7eea..315859d08 100644 --- a/trunk/src/core/srs_core_source.hpp +++ b/trunk/src/core/srs_core_source.hpp @@ -166,14 +166,16 @@ public: static SrsSource* find(std::string stream_url); private: std::string stream_url; + // to delivery stream to clients. std::vector consumers; -private: // hls handler. #ifdef SRS_HLS SrsHls* hls; #endif // gop cache for client fast startup. SrsGopCache* gop_cache; + // to forward stream to other servers + std::vector forwarders; private: /** * the sample rate of audio in metadata.