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
a1ae48f4ac
4 changed files with 67 additions and 119 deletions
|
@ -324,20 +324,13 @@ SrsCodecSampleUnit::~SrsCodecSampleUnit()
|
|||
|
||||
SrsCodecSample::SrsCodecSample()
|
||||
{
|
||||
reset();
|
||||
clear();
|
||||
}
|
||||
|
||||
SrsCodecSample::~SrsCodecSample()
|
||||
{
|
||||
}
|
||||
|
||||
void SrsCodecSample::reset()
|
||||
{
|
||||
clear();
|
||||
|
||||
open_gop = false;
|
||||
}
|
||||
|
||||
void SrsCodecSample::clear()
|
||||
{
|
||||
is_video = false;
|
||||
|
@ -346,7 +339,7 @@ void SrsCodecSample::clear()
|
|||
cts = 0;
|
||||
frame_type = SrsCodecVideoAVCFrameReserved;
|
||||
avc_packet_type = SrsCodecVideoAVCTypeReserved;
|
||||
has_aud = has_idr = false;
|
||||
has_sps_pps = has_aud = has_idr = false;
|
||||
first_nalu_type = SrsAvcNaluTypeReserved;
|
||||
|
||||
acodec = SrsCodecAudioReserved1;
|
||||
|
@ -377,6 +370,8 @@ int SrsCodecSample::add_sample_unit(char* bytes, int size)
|
|||
|
||||
if (nal_unit_type == SrsAvcNaluTypeIDR) {
|
||||
has_idr = true;
|
||||
} else if (nal_unit_type == SrsAvcNaluTypeSPS || nal_unit_type == SrsAvcNaluTypePPS) {
|
||||
has_sps_pps = true;
|
||||
} else if (nal_unit_type == SrsAvcNaluTypeAccessUnitDelimiter) {
|
||||
has_aud = true;
|
||||
}
|
||||
|
@ -773,11 +768,6 @@ int SrsAvcAacCodec::video_nalu_demux(SrsBuffer* stream, SrsCodecSample* sample)
|
|||
srs_info("hls decode avc payload in annexb format.");
|
||||
}
|
||||
|
||||
// for keyframe, but not IDR, it's open gop.
|
||||
if (sample->frame_type == SrsCodecVideoAVCFrameKeyFrame && !sample->has_idr) {
|
||||
sample->open_gop = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue