diff 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
line wrap: on
line diff
--- a/h264_parser.c	Fri May 28 07:22:04 2010 +0000
+++ b/h264_parser.c	Fri May 28 18:50:39 2010 +0000
@@ -245,6 +245,14 @@
     ParseContext *pc = &h->s.parse_context;
     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){
         next= buf_size;
     }else{
@@ -319,6 +327,7 @@
 {
     H264Context *h = s->priv_data;
     h->thread_context[0] = h;
+    h->first_picture = 1;
     return 0;
 }