1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #635, support IDR and NonIDR(open-gop).

This commit is contained in:
winlin 2017-01-10 17:17:23 +08:00
parent c9a71b7fb2
commit 4104f25069
4 changed files with 91 additions and 64 deletions

View file

@ -3010,7 +3010,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample)
static u_int8_t aud_nalu_7[] = { 0x09, 0xf0};
// For NonIDR(open gop), we directly appends all frames.
if (sample->has_non_idr || (sample->has_aud && sample->has_sei)) {
if (sample->open_gop) {
for (int i = 0; i < sample->nb_sample_units; i++) {
SrsCodecSampleUnit* sample_unit = &sample->sample_units[i];
int32_t size = sample_unit->size;
@ -3132,6 +3132,8 @@ int SrsTsEncoder::initialize(SrsFileWriter* fw)
return ret;
}
sample->reset();
return ret;
}