winlin

fix bug of hls and rename demo player stream to live/demo. change to 0.9.36

... ... @@ -3,6 +3,11 @@
# @see full.conf for detail config.
listen 19350;
daemon on;
srs_log_tank file;
srs_log_file ./objs/demo.19350.log;
pid ./objs/srs.demo.19350.pid;
vhost __defaultVhost__ {
enabled on;
gop_cache on;
... ...
... ... @@ -3,6 +3,11 @@
# @see full.conf for detail config.
listen 1935;
daemon on;
srs_log_tank file;
srs_log_file ./objs/demo.log;
pid ./objs/srs.demo.pid;
chunk_size 60000;
max_connections 2000;
... ...
... ... @@ -55,7 +55,7 @@ function build_default_rtmp_url() {
var port = (query.port == undefined)? 1935:query.port;
var vhost = (query.vhost == undefined)? window.location.hostname:query.vhost;
var app = (query.app == undefined)? "live":query.app;
var stream = (query.stream == undefined)? "livestream":query.stream;
var stream = (query.stream == undefined)? "demo":query.stream;
if (server == vhost || vhost == "") {
return "rtmp://" + server + ":" + port + "/" + app + "/" + stream;
... ... @@ -71,7 +71,7 @@ function build_default_publish_rtmp_url() {
var port = (query.port == undefined)? 1935:query.port;
var vhost = (query.vhost == undefined)? window.location.hostname:query.vhost;
var app = (query.app == undefined)? "live":query.app;
var stream = (query.stream == undefined)? "livestream":query.stream;
var stream = (query.stream == undefined)? "demo":query.stream;
if (server == vhost || vhost == "") {
return "rtmp://" + server + ":" + port + "/" + app + "/" + stream;
... ... @@ -114,7 +114,7 @@ function build_default_hls_url() {
var port = (query.hls_port == undefined)? window.location.port:query.hls_port;
var app = (query.app == undefined)? "live":query.app;
var stream = (query.stream == undefined)? "livestream":query.stream;
var stream = (query.stream == undefined)? "demo":query.stream;
if (port == "" || port == null || port == undefined) {
port = 80;
... ...
... ... @@ -2,6 +2,6 @@
for((;;)); do \
./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
-vcodec copy -acodec copy \
-f flv -y rtmp://127.0.0.1/live?vhost=players/livestream; \
-f flv -y rtmp://127.0.0.1/live?vhost=players/demo; \
sleep 1; \
done
... ...
... ... @@ -2,10 +2,10 @@
src_dir='src'
if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本"; exit 1; fi
cmd="nohup ./objs/srs -c conf/demo.19350.conf > ./objs/demo.19350.log 2>&1 &"
cmd="./objs/srs -c conf/demo.19350.conf"
echo "启动SRS转发服务器:$cmd"
pids=`ps aux|grep srs|grep "./objs"|grep "demo.19350.conf"|awk '{print $2}'`; for pid in $pids; do echo "结束现有进程:$pid"; kill -s SIGKILL $pid; done
nohup ./objs/srs -c conf/demo.19350.conf > ./objs/demo.19350.log 2>&1 &
./objs/srs -c conf/demo.19350.conf
ret=$?; if [[ 0 -ne $ret ]]; then echo "错误:启动SRS转发服务器失败"; exit $ret; fi
echo "启动SRS转发服务器成功"
... ...
... ... @@ -2,10 +2,10 @@
src_dir='src'
if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本"; exit 1; fi
cmd="nohup ./objs/srs -c conf/demo.conf >./objs/demo.log 2>&1 &"
cmd="./objs/srs -c conf/demo.conf"
echo "启动SRS服务器:$cmd"
pids=`ps aux|grep srs|grep "./objs"|grep "demo.conf"|awk '{print $2}'`; for pid in $pids; do echo "结束现有进程:$pid"; kill -s SIGKILL $pid; done
nohup ./objs/srs -c conf/demo.conf >./objs/demo.log 2>&1 &
./objs/srs -c conf/demo.conf
ret=$?; if [[ 0 -ne $ret ]]; then echo "错误:启动SRS失败"; exit $ret; fi
echo "启动SRS服务器成功"
... ...
... ... @@ -693,15 +693,17 @@ int SrsHlsMuxer::segment_close(string log_desc)
// close the muxer of finished segment.
srs_freep(current->muxer);
std::string full_path = current->full_path;
current = NULL;
// rename from tmp to real path
std::string tmp_file = current->full_path + ".tmp";
if (rename(tmp_file.c_str(), current->full_path.c_str()) < 0) {
std::string tmp_file = full_path + ".tmp";
if (rename(tmp_file.c_str(), full_path.c_str()) < 0) {
ret = ERROR_HLS_WRITE_FAILED;
srs_error("rename ts file failed, %s => %s. ret=%d",
tmp_file.c_str(), current->full_path.c_str(), ret);
tmp_file.c_str(), full_path.c_str(), ret);
return ret;
}
current = NULL;
} else {
// reuse current segment index.
file_index--;
... ...
... ... @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "35"
#define VERSION_REVISION "36"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
... ...