mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge branch '2.0release' into develop
This commit is contained in:
commit
e124aeb614
1 changed files with 19 additions and 22 deletions
|
@ -1555,6 +1555,24 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool srs_hls_can_continue(int ret, SrsSharedPtrMessage* sh, SrsSharedPtrMessage* msg)
|
||||
{
|
||||
// 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 == msg->size) {
|
||||
srs_warn("the msg is actually a sequence header, ignore this packet.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int SrsSource::on_audio_imp(SrsSharedPtrMessage* msg)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
@ -1615,9 +1633,7 @@ int SrsSource::on_audio_imp(SrsSharedPtrMessage* msg)
|
|||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
} else if (srs_config_hls_is_on_error_continue(hls_error_strategy)) {
|
||||
// compare the sequence header with audio, continue when it's actually an sequence header.
|
||||
if (ret == ERROR_HLS_DECODE_ERROR && cache_sh_audio && cache_sh_audio->size == msg->size) {
|
||||
srs_warn("the audio is actually a sequence header, ignore this packet.");
|
||||
if (srs_hls_can_continue(ret, cache_sh_audio, msg)) {
|
||||
ret = ERROR_SUCCESS;
|
||||
} else {
|
||||
srs_warn("hls continue audio failed. ret=%d", ret);
|
||||
|
@ -1770,23 +1786,6 @@ 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;
|
||||
|
@ -1850,9 +1849,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
|
|||
// ignore.
|
||||
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 (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 {
|
||||
srs_warn("hls continue video failed. ret=%d", ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue