else state>>=1; //2->1, 1->0, 0->0
}else if(state<=5){
int v= buf[i] & 0x1F;
- if(v==7 || v==8 || v==9){
+ if(v==6 || v==7 || v==8 || v==9){
if(pc->frame_start_found){
i++;
goto found;
const uint8_t *buf_end = buf + buf_size;
unsigned int pps_id;
unsigned int slice_type;
- int state;
+ int state = -1;
const uint8_t *ptr;
/* set some sane default values */
parse_nal_units(s, avctx, buf, buf_size);
- s->dts_sync_point = h->sei_buffering_period_present;
- s->dts_ref_dts_delta = h->sei_cpb_removal_delay;
- s->pts_dts_delta = h->sei_dpb_output_delay;
+ if (h->sei_cpb_removal_delay >= 0) {
+ s->dts_sync_point = h->sei_buffering_period_present;
+ s->dts_ref_dts_delta = h->sei_cpb_removal_delay;
+ s->pts_dts_delta = h->sei_dpb_output_delay;
+ } else {
+ s->dts_sync_point = INT_MIN;
+ s->dts_ref_dts_delta = INT_MIN;
+ s->pts_dts_delta = INT_MIN;
+ }
}
*poutbuf = buf;
ParseContext *pc = &h->s.parse_context;
av_free(pc->buffer);
+ ff_h264_free_context(h);
}