[FFmpeg-cvslog] Merge commit '187d719760bd130f848194ec4a6bd476341914bb'

Clément Bœsch git at videolan.org
Sat Jul 9 15:07:27 CEST 2016


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat Jul  9 15:03:27 2016 +0200| [c67aa7f287e791b2c02c0c6471336c8adc88020e] | committer: Clément Bœsch

Merge commit '187d719760bd130f848194ec4a6bd476341914bb'

* commit '187d719760bd130f848194ec4a6bd476341914bb':
  h264: Support AV_PKT_DATA_NEW_EXTRADATA

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c67aa7f287e791b2c02c0c6471336c8adc88020e
---

 libavcodec/h264.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8eb3b13..b4eae37 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1235,6 +1235,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
     H264Picture *out;
     int i, out_idx;
     int ret;
+    const uint8_t *new_extradata;
+    int new_extradata_size;
 
     h->flags = avctx->flags;
     h->setup_finished = 0;
@@ -1302,6 +1304,17 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
                                             avctx->err_recognition, avctx);
     }
 
+    new_extradata_size = 0;
+    new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+                                            &new_extradata_size);
+    if (new_extradata_size > 0 && new_extradata) {
+        ret = ff_h264_decode_extradata(new_extradata, new_extradata_size,
+                                       &h->ps, &h->is_avc, &h->nal_length_size,
+                                       avctx->err_recognition, avctx);
+        if (ret < 0)
+            return ret;
+    }
+
     buf_index = decode_nal_units(h, buf, buf_size);
     if (buf_index < 0)
         return AVERROR_INVALIDDATA;


======================================================================

diff --cc libavcodec/h264.c
index 8eb3b13,2dba261..b4eae37
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@@ -1232,9 -1003,9 +1232,11 @@@ static int h264_decode_frame(AVCodecCon
      H264Context *h     = avctx->priv_data;
      AVFrame *pict      = data;
      int buf_index      = 0;
 +    H264Picture *out;
 +    int i, out_idx;
      int ret;
+     const uint8_t *new_extradata;
+     int new_extradata_size;
  
      h->flags = avctx->flags;
      h->setup_finished = 0;
@@@ -1287,21 -1043,18 +1289,32 @@@
  
          return buf_index;
      }
 +    if (h->is_avc && av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, NULL)) {
 +        int side_size;
 +        uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size);
 +        if (is_extra(side, side_size))
 +            ff_h264_decode_extradata(side, side_size,
 +                                     &h->ps, &h->is_avc, &h->nal_length_size,
 +                                     avctx->err_recognition, avctx);
 +    }
 +    if(h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC && (buf[5]&0x1F) && buf[8]==0x67){
 +        if (is_extra(buf, buf_size))
 +            return ff_h264_decode_extradata(buf, buf_size,
 +                                            &h->ps, &h->is_avc, &h->nal_length_size,
 +                                            avctx->err_recognition, avctx);
 +    }
  
+     new_extradata_size = 0;
+     new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+                                             &new_extradata_size);
+     if (new_extradata_size > 0 && new_extradata) {
+         ret = ff_h264_decode_extradata(new_extradata, new_extradata_size,
+                                        &h->ps, &h->is_avc, &h->nal_length_size,
+                                        avctx->err_recognition, avctx);
+         if (ret < 0)
+             return ret;
+     }
+ 
      buf_index = decode_nal_units(h, buf, buf_size);
      if (buf_index < 0)
          return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list