ctx->ps_modified = GF_TRUE;
ctx->crc_cfg = ctx->crc_cfg_enh = 0;
}
-
+
return GF_OK;
}
if (!vps_sl) return GF_SERVICE_ERROR;
vps = &ctx->hevc_state->vps[vps_sl->id];
-
+
if (!vps->vps_extension_found) return GF_OK;
if (vps->max_layers<2) return GF_OK;
return;
bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
-
+
gf_bs_write_int(bs, 0, 2);
gf_bs_write_int(bs, nb_layers, 6);
for (i=0; i<nb_layers; i++) {
*skip_nal = GF_TRUE;
}
ctx->nb_nalus++;
-
+
switch (nal_type) {
case GF_AVC_NALU_SVC_SUBSEQ_PARAM:
case GF_AVC_NALU_SEQ_PARAM:
u32 i;
for (i = 0; i < gf_list_count(ctx->pps); i ++) {
GF_AVCConfigSlot *slc = (GF_AVCConfigSlot*)gf_list_get(ctx->pps, i);
- if (ctx->avc_state->s_info.pps->id == slc->id) {
+ if (ctx->avc_state->s_info.pps && ctx->avc_state->s_info.pps->id == slc->id) {
/* This PPS is used by an SVC NAL unit, it should be moved to the SVC Config Record) */
gf_list_rem(ctx->pps, i);
i--;
if (!ctx->opid && current) {
assert(remain>=current);
assert((s32) current >= 0);
-
+
start += current;
remain -= current;
current = 0;
//we should only parse senc/psec when no saiz/saio is present, otherwise we fetch the info directly
if (traf->trex && traf->tfhd && traf->trex->track && traf->sample_encryption) {
GF_TrackBox *trak = GetTrackbyID(mov->moov, traf->tfhd->trackID);
- trak->current_traf_stsd_idx = traf->tfhd->sample_desc_index ? traf->tfhd->sample_desc_index : traf->trex->def_sample_desc_index;
- e = senc_Parse(mov->movieFileMap->bs, trak, traf, traf->sample_encryption);
- if (e) return e;
- trak->current_traf_stsd_idx = 0;
+ if (trak) {
+ trak->current_traf_stsd_idx = traf->tfhd->sample_desc_index ? traf->tfhd->sample_desc_index : traf->trex->def_sample_desc_index;
+ e = senc_Parse(mov->movieFileMap->bs, trak, traf, traf->sample_encryption);
+ if (e) return e;
+ trak->current_traf_stsd_idx = 0;
+ }
}
}
} else {