diff --git a/README.md b/README.md index d2c68b891..cdb19fb1b 100755 --- a/README.md +++ b/README.md @@ -342,6 +342,7 @@ Remark: ## History +* v2.0, 2015-08-18, close [#454](https://github.com/simple-rtmp-server/srs/issues/454), support obs restart publish. 2.0.184 * v2.0, 2015-08-14, use reduce_sequence_header for stream control. * v2.0, 2015-08-14, use send_min_interval for stream control. 2.0.183 * v2.0, 2015-08-12, enable the SRS_PERF_TCP_NODELAY and add config tcp_nodelay. 2.0.182 diff --git a/trunk/configure b/trunk/configure index d705c6ceb..f11cd25e7 100755 --- a/trunk/configure +++ b/trunk/configure @@ -508,10 +508,15 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then else echo -e "${YELLOW}warning: without HLS support${BLACK}" fi - if [ $SRS_HDS = YES ]; then - echo -e "${GREEN}HDS is enabled${BLACK}" + if [ $SRS_STREAM_CASTER = YES ]; then + echo -e "${YELLOW}Experiment: StreamCaster is enabled${BLACK}" else - echo -e "${YELLOW}warning: without HDS support${BLACK}" + echo -e "${GREEN}note: without StreamCaster support${BLACK}" + fi + if [ $SRS_HDS = YES ]; then + echo -e "${YELLOW}Experiment: HDS is enabled${BLACK}" + else + echo -e "${GREEN}warning: without HDS support${BLACK}" fi if [ $SRS_NGINX = YES ]; then echo -e "${GREEN}Nginx http server is enabled${BLACK}" diff --git a/trunk/src/app/srs_app_recv_thread.cpp b/trunk/src/app/srs_app_recv_thread.cpp index e402643d4..e94b622dd 100644 --- a/trunk/src/app/srs_app_recv_thread.cpp +++ b/trunk/src/app/srs_app_recv_thread.cpp @@ -96,7 +96,7 @@ int SrsRecvThread::cycle() } if (ret != ERROR_SUCCESS) { - if (!srs_is_client_gracefully_close(ret)) { + if (!srs_is_client_gracefully_close(ret) && !srs_is_system_control_error(ret)) { srs_error("thread process message failed. ret=%d", ret); } diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index f63456abb..43c3951a9 100755 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -337,6 +337,16 @@ int SrsRtmpConn::service_cycle() } } + // set chunk size to larger. + // set the chunk size before any larger response greater than 128, + // to make OBS happy, @see https://github.com/simple-rtmp-server/srs/issues/454 + int chunk_size = _srs_config->get_chunk_size(req->vhost); + if ((ret = rtmp->set_chunk_size(chunk_size)) != ERROR_SUCCESS) { + srs_error("set chunk_size=%d failed. ret=%d", chunk_size, ret); + return ret; + } + srs_info("set chunk_size=%d success", chunk_size); + // response the client connect ok. if ((ret = rtmp->response_connect_app(req, local_ip.c_str())) != ERROR_SUCCESS) { srs_error("response connect app failed. ret=%d", ret); @@ -424,14 +434,6 @@ int SrsRtmpConn::stream_service_cycle() rtmp->set_recv_timeout(SRS_CONSTS_RTMP_RECV_TIMEOUT_US); rtmp->set_send_timeout(SRS_CONSTS_RTMP_SEND_TIMEOUT_US); - // set chunk size to larger. - int chunk_size = _srs_config->get_chunk_size(req->vhost); - if ((ret = rtmp->set_chunk_size(chunk_size)) != ERROR_SUCCESS) { - srs_error("set chunk_size=%d failed. ret=%d", chunk_size, ret); - return ret; - } - srs_info("set chunk_size=%d success", chunk_size); - // find a source to serve. SrsSource* source = SrsSource::fetch(req); if (!source) { @@ -637,7 +639,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe // quit when recv thread error. if ((ret = trd->error_code()) != ERROR_SUCCESS) { - if (!srs_is_client_gracefully_close(ret)) { + if (!srs_is_client_gracefully_close(ret) && !srs_is_system_control_error(ret)) { srs_error("recv thread failed. ret=%d", ret); } return ret; @@ -824,7 +826,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd) // check the thread error code. if ((ret = trd->error_code()) != ERROR_SUCCESS) { - if (!srs_is_client_gracefully_close(ret)) { + if (!srs_is_system_control_error(ret) && !srs_is_client_gracefully_close(ret)) { srs_error("recv thread failed. ret=%d", ret); } return ret; diff --git a/trunk/src/app/srs_app_thread.cpp b/trunk/src/app/srs_app_thread.cpp index 0007df3ea..097758563 100644 --- a/trunk/src/app/srs_app_thread.cpp +++ b/trunk/src/app/srs_app_thread.cpp @@ -187,7 +187,7 @@ namespace internal { srs_info("thread %s on before cycle success"); if ((ret = handler->cycle()) != ERROR_SUCCESS) { - if (!srs_is_client_gracefully_close(ret)) { + if (!srs_is_client_gracefully_close(ret) && !srs_is_system_control_error(ret)) { srs_warn("thread %s cycle failed, ignored and retry, ret=%d", _name, ret); } goto failed; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index d640f1deb..be9c02c4d 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 183 +#define VERSION_REVISION 184 // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp index d3658999f..fce86ac5f 100644 --- a/trunk/src/protocol/srs_rtmp_stack.cpp +++ b/trunk/src/protocol/srs_rtmp_stack.cpp @@ -2924,7 +2924,9 @@ int SrsRtmpServer::fmle_unpublish(int stream_id, double unpublish_tid) pkt->data->set(StatusDescription, SrsAmf0Any::str("Stop publishing stream.")); if ((ret = protocol->send_and_free_packet(pkt, stream_id)) != ERROR_SUCCESS) { - srs_error("send onFCUnpublish(NetStream.unpublish.Success) message failed. ret=%d", ret); + if (!srs_is_system_control_error(ret) && !srs_is_client_gracefully_close(ret)) { + srs_error("send onFCUnpublish(NetStream.unpublish.Success) message failed. ret=%d", ret); + } return ret; } srs_info("send onFCUnpublish(NetStream.unpublish.Success) message success."); @@ -2933,7 +2935,9 @@ int SrsRtmpServer::fmle_unpublish(int stream_id, double unpublish_tid) if (true) { SrsFMLEStartResPacket* pkt = new SrsFMLEStartResPacket(unpublish_tid); if ((ret = protocol->send_and_free_packet(pkt, stream_id)) != ERROR_SUCCESS) { - srs_error("send FCUnpublish response message failed. ret=%d", ret); + if (!srs_is_system_control_error(ret) && !srs_is_client_gracefully_close(ret)) { + srs_error("send FCUnpublish response message failed. ret=%d", ret); + } return ret; } srs_info("send FCUnpublish response message success."); @@ -2948,7 +2952,9 @@ int SrsRtmpServer::fmle_unpublish(int stream_id, double unpublish_tid) pkt->data->set(StatusClientId, SrsAmf0Any::str(RTMP_SIG_CLIENT_ID)); if ((ret = protocol->send_and_free_packet(pkt, stream_id)) != ERROR_SUCCESS) { - srs_error("send onStatus(NetStream.Unpublish.Success) message failed. ret=%d", ret); + if (!srs_is_system_control_error(ret) && !srs_is_client_gracefully_close(ret)) { + srs_error("send onStatus(NetStream.Unpublish.Success) message failed. ret=%d", ret); + } return ret; } srs_info("send onStatus(NetStream.Unpublish.Success) message success.");