int i;
uint32_t state;
ParseContext *pc = &(h->s.parse_context);
-//printf("first %02X%02X%02X%02X\n", buf[0], buf[1],buf[2],buf[3]);
// mb_addr= pc->mb_addr - 1;
state= pc->state;
if(state>13)
h->got_first = 1;
if (avctx->extradata_size) {
h->s.avctx = avctx;
+ // must be done like in the decoder.
+ // otherwise opening the parser, creating extradata,
+ // and then closing and opening again
+ // will cause has_b_frames to be always set.
+ // NB: estimate_timings_from_pts behaves exactly like this.
+ if (!avctx->has_b_frames)
+ h->s.low_delay = 1;
ff_h264_decode_extradata(h);
}
}
{
H264Context *h = s->priv_data;
h->thread_context[0] = h;
+ h->s.slice_context_count = 1;
return 0;
}
AVCodecParser ff_h264_parser = {
- { CODEC_ID_H264 },
- sizeof(H264Context),
- init,
- h264_parse,
- close,
- h264_split,
+ .codec_ids = { AV_CODEC_ID_H264 },
+ .priv_data_size = sizeof(H264Context),
+ .parser_init = init,
+ .parser_parse = h264_parse,
+ .parser_close = close,
+ .split = h264_split,
};