mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
abs overflow also plus the deviation, for pure audio hls.
This commit is contained in:
parent
c514a4ceeb
commit
d19dfa528e
4 changed files with 66 additions and 22 deletions
|
@ -561,7 +561,7 @@ void SrsIngestSrsInput::fetch_all_ts(bool fresh_m3u8)
|
|||
}
|
||||
|
||||
// only wait for a duration of last piece.
|
||||
if (i == pieces.size() - 1) {
|
||||
if (i == (int)pieces.size() - 1) {
|
||||
next_connect_time = srs_update_system_time_ms() + (int)tp->duration * 1000;
|
||||
}
|
||||
}
|
||||
|
@ -865,28 +865,34 @@ int SrsIngestSrsOutput::parse_message_queue()
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
int nb_videos = 0;
|
||||
int nb_audios = 0;
|
||||
std::multimap<int64_t, SrsTsMessage*>::iterator it;
|
||||
for (it = queue.begin(); it != queue.end(); ++it) {
|
||||
SrsTsMessage* msg = it->second;
|
||||
|
||||
// publish audio or video.
|
||||
if (msg->channel->stream == SrsTsStreamVideoH264) {
|
||||
nb_videos++;
|
||||
} else {
|
||||
nb_audios++;
|
||||
}
|
||||
}
|
||||
|
||||
// always wait 2+ videos, to left one video in the queue.
|
||||
// TODO: FIXME: support pure audio hls.
|
||||
if (nb_videos <= 1) {
|
||||
if (queue.empty()) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsTsMessage* first_ts_msg = queue.begin()->second;
|
||||
SrsTsContext* context = first_ts_msg->channel->context;
|
||||
|
||||
int nb_videos = 0;
|
||||
if (!context->is_pure_audio()) {
|
||||
std::multimap<int64_t, SrsTsMessage*>::iterator it;
|
||||
for (it = queue.begin(); it != queue.end(); ++it) {
|
||||
SrsTsMessage* msg = it->second;
|
||||
|
||||
// publish audio or video.
|
||||
if (msg->channel->stream == SrsTsStreamVideoH264) {
|
||||
nb_videos++;
|
||||
}
|
||||
}
|
||||
|
||||
// always wait 2+ videos, to left one video in the queue.
|
||||
// TODO: FIXME: support pure audio hls.
|
||||
if (nb_videos <= 1) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// parse messages util the last video.
|
||||
while (nb_videos > 1 && queue.size() > 0) {
|
||||
while ((nb_videos > 1 || context->is_pure_audio()) && queue.size() > 0) {
|
||||
std::multimap<int64_t, SrsTsMessage*>::iterator it = queue.begin();
|
||||
|
||||
SrsTsMessage* msg = it->second;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue