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
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;
|
||||
}
|
||||
|
||||
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 ret = ERROR_SUCCESS;
|
||||
|
@ -1827,7 +1844,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
|
|||
ret = ERROR_SUCCESS;
|
||||
} 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.
|
||||
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.");
|
||||
ret = ERROR_SUCCESS;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue