mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #310, workaround to force to LC/MAIN, donot support SSR above. 2.0.113
This commit is contained in:
parent
f8bdd28de6
commit
4820d455d5
5 changed files with 97 additions and 44 deletions
|
@ -309,6 +309,12 @@ int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab)
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// if flushed yet, ignore.
|
||||
if (ab->length() == 0) {
|
||||
srs_info("ignore hls segment audio flushed yet.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
// if current is NULL, segment is not open, ignore the flush event.
|
||||
if (!current) {
|
||||
srs_warn("flush audio ignored, for segment is not open.");
|
||||
|
@ -336,6 +342,12 @@ int SrsHlsMuxer::flush_video(SrsMpegtsFrame* /*af*/, SrsSimpleBuffer* /*ab*/, Sr
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// if flushed yet, ignore.
|
||||
if (vb->length() == 0) {
|
||||
srs_info("ignore hls segment video flushed yet.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
// if current is NULL, segment is not open, ignore the flush event.
|
||||
if (!current) {
|
||||
srs_warn("flush video ignored, for segment is not open.");
|
||||
|
@ -776,6 +788,13 @@ int SrsHlsCache::reap_segment(string log_desc, SrsHlsMuxer* muxer, int64_t segme
|
|||
}
|
||||
|
||||
// TODO: flush audio before or after segment?
|
||||
|
||||
// segment open, flush video first.
|
||||
if ((ret = muxer->flush_video(cache->af, cache->ab, cache->vf, cache->vb)) != ERROR_SUCCESS) {
|
||||
srs_error("m3u8 muxer flush video failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// segment open, flush the audio.
|
||||
// @see: ngx_rtmp_hls_open_fragment
|
||||
/* start fragment with audio to make iPhone happy */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue