1
0
Fork 0
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:
winlin 2015-04-21 14:35:28 +08:00
parent c514a4ceeb
commit d19dfa528e
4 changed files with 66 additions and 22 deletions

View file

@ -78,6 +78,7 @@ SrsTsChannel::SrsTsChannel()
stream = SrsTsStreamReserved;
msg = NULL;
continuity_counter = 0;
context = NULL;
}
SrsTsChannel::~SrsTsChannel()
@ -196,6 +197,7 @@ ISrsTsHandler::~ISrsTsHandler()
SrsTsContext::SrsTsContext()
{
pure_audio = false;
vcodec = SrsCodecVideoReserved;
acodec = SrsCodecAudioReserved1;
}
@ -210,6 +212,24 @@ SrsTsContext::~SrsTsContext()
pids.clear();
}
bool SrsTsContext::is_pure_audio()
{
return pure_audio;
}
void SrsTsContext::on_pmt_parsed()
{
pure_audio = true;
std::map<int, SrsTsChannel*>::iterator it;
for (it = pids.begin(); it != pids.end(); ++it) {
SrsTsChannel* channel = it->second;
if (channel->apply == SrsTsPidApplyVideo) {
pure_audio = false;
}
}
}
void SrsTsContext::reset()
{
vcodec = SrsCodecVideoReserved;
@ -230,6 +250,7 @@ void SrsTsContext::set(int pid, SrsTsPidApply apply_pid, SrsTsStream stream)
if (pids.find(pid) == pids.end()) {
channel = new SrsTsChannel();
channel->context = this;
pids[pid] = channel;
} else {
channel = pids[pid];
@ -2302,6 +2323,7 @@ int SrsTsPayloadPAT::psi_decode(SrsStream* stream)
// update the apply pid table.
packet->context->set(packet->pid, SrsTsPidApplyPAT);
packet->context->on_pmt_parsed();
return ret;
}