Commit d262d3df authored by hyc's avatar hyc

Parse avctx->extradata if available.

Fixes many "non-existing PPS referenced" error messages


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23363 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 45797731
...@@ -465,6 +465,7 @@ typedef struct H264Context{ ...@@ -465,6 +465,7 @@ typedef struct H264Context{
int is_avc; ///< this flag is != 0 if codec is avc1 int is_avc; ///< this flag is != 0 if codec is avc1
int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
int first_picture;
SPS *sps_buffers[MAX_SPS_COUNT]; SPS *sps_buffers[MAX_SPS_COUNT];
PPS *pps_buffers[MAX_PPS_COUNT]; PPS *pps_buffers[MAX_PPS_COUNT];
......
...@@ -245,6 +245,14 @@ static int h264_parse(AVCodecParserContext *s, ...@@ -245,6 +245,14 @@ static int h264_parse(AVCodecParserContext *s,
ParseContext *pc = &h->s.parse_context; ParseContext *pc = &h->s.parse_context;
int next; int next;
if (h->first_picture) {
h->first_picture = 0;
if (avctx->extradata_size) {
h->s.avctx = avctx;
ff_h264_decode_extradata(h);
}
}
if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
next= buf_size; next= buf_size;
}else{ }else{
...@@ -319,6 +327,7 @@ static int init(AVCodecParserContext *s) ...@@ -319,6 +327,7 @@ static int init(AVCodecParserContext *s)
{ {
H264Context *h = s->priv_data; H264Context *h = s->priv_data;
h->thread_context[0] = h; h->thread_context[0] = h;
h->first_picture = 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment