diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-06-09 18:55:17 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-06-17 11:05:33 -0400 |
commit | 187d719760bd130f848194ec4a6bd476341914bb (patch) | |
tree | 5c90a62cf3bc8ddffae604ab559f5bcba8fa6c12 /libavcodec/h264.c | |
parent | 75872d77d215d64b8d9430df23c6c74ff921227b (diff) | |
download | ffmpeg-187d719760bd130f848194ec4a6bd476341914bb.tar.gz |
h264: Support AV_PKT_DATA_NEW_EXTRADATA
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 224ba2fa27..2dba26116d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1004,6 +1004,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, AVFrame *pict = data; int buf_index = 0; int ret; + const uint8_t *new_extradata; + int new_extradata_size; h->flags = avctx->flags; h->setup_finished = 0; @@ -1042,6 +1044,17 @@ out: return buf_index; } + 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; |