mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
close #454, support obs restart publish. 2.0.184
This commit is contained in:
parent
ccc4c05da9
commit
2cf526ffc7
7 changed files with 33 additions and 19 deletions
|
@ -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
|
||||
|
|
11
trunk/configure
vendored
11
trunk/configure
vendored
|
@ -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}"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue