mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #264, support disconnect publish connect when hls error. 1.0.11
This commit is contained in:
parent
d4fb58b175
commit
1dfac0bf1d
6 changed files with 71 additions and 20 deletions
|
@ -1056,13 +1056,21 @@ int SrsSource::on_audio(SrsMessage* __audio)
|
|||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->on_audio(msg.copy())) != ERROR_SUCCESS) {
|
||||
srs_warn("hls process audio message failed, ignore and disable hls. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hls->on_unpublish();
|
||||
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
// apply the error strategy for hls.
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/264
|
||||
std::string hls_error_strategy = _srs_config->get_hls_on_error(_req->vhost);
|
||||
if (hls_error_strategy == SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE) {
|
||||
srs_warn("hls process audio message failed, ignore and disable hls. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hls->on_unpublish();
|
||||
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
} else {
|
||||
srs_warn("hls disconnect publisher for audio error. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1113,7 +1121,7 @@ int SrsSource::on_audio(SrsMessage* __audio)
|
|||
SrsAvcAacCodec codec;
|
||||
SrsCodecSample sample;
|
||||
if ((ret = codec.audio_aac_demux(msg.payload, msg.size, &sample)) != ERROR_SUCCESS) {
|
||||
srs_error("codec demux audio failed. ret=%d", ret);
|
||||
srs_error("source codec demux audio failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1165,13 +1173,21 @@ int SrsSource::on_video(SrsMessage* __video)
|
|||
|
||||
#ifdef SRS_AUTO_HLS
|
||||
if ((ret = hls->on_video(msg.copy())) != ERROR_SUCCESS) {
|
||||
srs_warn("hls process video message failed, ignore and disable hls. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hls->on_unpublish();
|
||||
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
// apply the error strategy for hls.
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/264
|
||||
std::string hls_error_strategy = _srs_config->get_hls_on_error(_req->vhost);
|
||||
if (hls_error_strategy == SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE) {
|
||||
srs_warn("hls process video message failed, ignore and disable hls. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hls->on_unpublish();
|
||||
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
} else {
|
||||
srs_warn("hls disconnect publisher for video error. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1222,7 +1238,7 @@ int SrsSource::on_video(SrsMessage* __video)
|
|||
SrsAvcAacCodec codec;
|
||||
SrsCodecSample sample;
|
||||
if ((ret = codec.video_avc_demux(msg.payload, msg.size, &sample)) != ERROR_SUCCESS) {
|
||||
srs_error("codec demux video failed. ret=%d", ret);
|
||||
srs_error("source codec demux video failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue