|
|
@@ -847,7 +847,7 @@ fail: |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int is_extra(const uint8_t *buf, int buf_size) |
|
|
|
|
|
|
|
|
static int is_avcc_extradata(const uint8_t *buf, int buf_size) |
|
|
{ |
|
|
{ |
|
|
int cnt= buf[5]&0x1f; |
|
|
int cnt= buf[5]&0x1f; |
|
|
const uint8_t *p= buf+6; |
|
|
const uint8_t *p= buf+6; |
|
|
@@ -974,16 +974,15 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, |
|
|
if (buf_size == 0) |
|
|
if (buf_size == 0) |
|
|
return send_next_delayed_frame(h, pict, got_frame, 0); |
|
|
return send_next_delayed_frame(h, pict, got_frame, 0); |
|
|
|
|
|
|
|
|
if (h->is_avc && av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, NULL)) { |
|
|
|
|
|
|
|
|
if (av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, NULL)) { |
|
|
int side_size; |
|
|
int side_size; |
|
|
uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &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); |
|
|
|
|
|
|
|
|
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) { |
|
|
if (h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC) { |
|
|
if (is_extra(buf, buf_size)) |
|
|
|
|
|
|
|
|
if (is_avcc_extradata(buf, buf_size)) |
|
|
return ff_h264_decode_extradata(buf, buf_size, |
|
|
return ff_h264_decode_extradata(buf, buf_size, |
|
|
&h->ps, &h->is_avc, &h->nal_length_size, |
|
|
&h->ps, &h->is_avc, &h->nal_length_size, |
|
|
avctx->err_recognition, avctx); |
|
|
avctx->err_recognition, avctx); |
|
|
|