mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
default hls_on_error to continue. 2.0.201
This commit is contained in:
parent
26d328e7f2
commit
40457e6cab
5 changed files with 26 additions and 8 deletions
|
@ -337,6 +337,7 @@ Remark:
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
|
* v2.0, 2015-12-15, default hls_on_error to continue. 2.0.201
|
||||||
* v2.0, 2015-11-16, for [#518][bug #518] fix fd leak bug when fork. 2.0.200
|
* v2.0, 2015-11-16, for [#518][bug #518] fix fd leak bug when fork. 2.0.200
|
||||||
* v2.0, 2015-11-05, for [#511][bug #511] fix bug for restart thread. 2.0.199
|
* v2.0, 2015-11-05, for [#511][bug #511] fix bug for restart thread. 2.0.199
|
||||||
* v2.0, 2015-11-02, for [#515][bug #515] use srs_freepa and SrsAutoFreeA for array. 2.0.198
|
* v2.0, 2015-11-02, for [#515][bug #515] use srs_freepa and SrsAutoFreeA for array. 2.0.198
|
||||||
|
|
|
@ -539,12 +539,12 @@ vhost with-hls.srs.com {
|
||||||
# default: 60
|
# default: 60
|
||||||
hls_window 60;
|
hls_window 60;
|
||||||
# the error strategy. canbe:
|
# the error strategy. canbe:
|
||||||
# ignore, when error ignore and disable hls.
|
# ignore, disable the hls.
|
||||||
# disconnect, when error disconnect the publish connection.
|
# disconnect, require encoder republish.
|
||||||
# continue, when error ignore and continue output hls.
|
# continue, ignore failed try to continue output hls.
|
||||||
# @see https://github.com/ossrs/srs/issues/264
|
# @see https://github.com/ossrs/srs/issues/264
|
||||||
# default: ignore
|
# default: continue
|
||||||
hls_on_error ignore;
|
hls_on_error continue;
|
||||||
# the hls storage: disk, ram or both.
|
# the hls storage: disk, ram or both.
|
||||||
# disk, to write hls m3u8/ts to disk.
|
# disk, to write hls m3u8/ts to disk.
|
||||||
# ram, serve m3u8/ts in memory, which use embeded http server to delivery.
|
# ram, serve m3u8/ts in memory, which use embeded http server to delivery.
|
||||||
|
|
|
@ -75,7 +75,7 @@ using namespace _srs_internal;
|
||||||
#define SRS_CONF_DEFAULT_HLS_TD_RATIO 1.5
|
#define SRS_CONF_DEFAULT_HLS_TD_RATIO 1.5
|
||||||
#define SRS_CONF_DEFAULT_HLS_AOF_RATIO 2.0
|
#define SRS_CONF_DEFAULT_HLS_AOF_RATIO 2.0
|
||||||
#define SRS_CONF_DEFAULT_HLS_WINDOW 60
|
#define SRS_CONF_DEFAULT_HLS_WINDOW 60
|
||||||
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE "ignore"
|
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE "continue"
|
||||||
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_DISCONNECT "disconnect"
|
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_DISCONNECT "disconnect"
|
||||||
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_CONTINUE "continue"
|
#define SRS_CONF_DEFAULT_HLS_ON_ERROR_CONTINUE "continue"
|
||||||
#define SRS_CONF_DEFAULT_HLS_ON_ERROR SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE
|
#define SRS_CONF_DEFAULT_HLS_ON_ERROR SRS_CONF_DEFAULT_HLS_ON_ERROR_IGNORE
|
||||||
|
|
19
trunk/src/app/srs_app_source.cpp
Executable file → Normal file
19
trunk/src/app/srs_app_source.cpp
Executable file → Normal file
|
@ -1763,6 +1763,23 @@ int SrsSource::on_video(SrsCommonMessage* shared_video)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool srs_hls_can_continue(int ret, SrsSharedPtrMessage* sh, SrsSharedPtrMessage* video)
|
||||||
|
{
|
||||||
|
// only continue for decode error.
|
||||||
|
if (ret != ERROR_HLS_DECODE_ERROR) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// when video size equals to sequence header,
|
||||||
|
// the video actually maybe a sequence header,
|
||||||
|
// continue to make ffmpeg happy.
|
||||||
|
if (sh && sh->size == video->size) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
|
int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
@ -1827,7 +1844,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
|
||||||
ret = ERROR_SUCCESS;
|
ret = ERROR_SUCCESS;
|
||||||
} else if (srs_config_hls_is_on_error_continue(hls_error_strategy)) {
|
} else if (srs_config_hls_is_on_error_continue(hls_error_strategy)) {
|
||||||
// compare the sequence header with video, continue when it's actually an sequence header.
|
// compare the sequence header with video, continue when it's actually an sequence header.
|
||||||
if (ret == ERROR_HLS_DECODE_ERROR && cache_sh_video && cache_sh_video->size == msg->size) {
|
if (srs_hls_can_continue(ret, cache_sh_video, msg)) {
|
||||||
srs_warn("the video is actually a sequence header, ignore this packet.");
|
srs_warn("the video is actually a sequence header, ignore this packet.");
|
||||||
ret = ERROR_SUCCESS;
|
ret = ERROR_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// current release version
|
// current release version
|
||||||
#define VERSION_MAJOR 2
|
#define VERSION_MAJOR 2
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 200
|
#define VERSION_REVISION 201
|
||||||
|
|
||||||
// server info.
|
// server info.
|
||||||
#define RTMP_SIG_SRS_KEY "SRS"
|
#define RTMP_SIG_SRS_KEY "SRS"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue