Mercurial > libavcodec.hg
comparison h264_parser.c @ 11790:f918fb753b31 libavcodec
Parse avctx->extradata if available.
Fixes many "non-existing PPS referenced" error messages
author | hyc |
---|---|
date | Fri, 28 May 2010 18:50:39 +0000 |
parents | 6d58a4f5e455 |
children | 51abd780bda6 |
comparison
equal
deleted
inserted
replaced
11789:2064f8a1691e | 11790:f918fb753b31 |
---|---|
243 { | 243 { |
244 H264Context *h = s->priv_data; | 244 H264Context *h = s->priv_data; |
245 ParseContext *pc = &h->s.parse_context; | 245 ParseContext *pc = &h->s.parse_context; |
246 int next; | 246 int next; |
247 | 247 |
248 if (h->first_picture) { | |
249 h->first_picture = 0; | |
250 if (avctx->extradata_size) { | |
251 h->s.avctx = avctx; | |
252 ff_h264_decode_extradata(h); | |
253 } | |
254 } | |
255 | |
248 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ | 256 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ |
249 next= buf_size; | 257 next= buf_size; |
250 }else{ | 258 }else{ |
251 next= ff_h264_find_frame_end(h, buf, buf_size); | 259 next= ff_h264_find_frame_end(h, buf, buf_size); |
252 | 260 |
317 | 325 |
318 static int init(AVCodecParserContext *s) | 326 static int init(AVCodecParserContext *s) |
319 { | 327 { |
320 H264Context *h = s->priv_data; | 328 H264Context *h = s->priv_data; |
321 h->thread_context[0] = h; | 329 h->thread_context[0] = h; |
330 h->first_picture = 1; | |
322 return 0; | 331 return 0; |
323 } | 332 } |
324 | 333 |
325 AVCodecParser h264_parser = { | 334 AVCodecParser h264_parser = { |
326 { CODEC_ID_H264 }, | 335 { CODEC_ID_H264 }, |