mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
h264: Support AV_PKT_DATA_NEW_EXTRADATA
This commit is contained in:
parent
75872d77d2
commit
187d719760
@ -1004,6 +1004,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
AVFrame *pict = data;
|
AVFrame *pict = data;
|
||||||
int buf_index = 0;
|
int buf_index = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
const uint8_t *new_extradata;
|
||||||
|
int new_extradata_size;
|
||||||
|
|
||||||
h->flags = avctx->flags;
|
h->flags = avctx->flags;
|
||||||
h->setup_finished = 0;
|
h->setup_finished = 0;
|
||||||
@ -1042,6 +1044,17 @@ out:
|
|||||||
return buf_index;
|
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);
|
buf_index = decode_nal_units(h, buf, buf_size);
|
||||||
if (buf_index < 0)
|
if (buf_index < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user