Commit a9275b4f authored by Michael Niedermayer's avatar Michael Niedermayer

h264: Fix code to also handle pix format changes.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 41135b7f
...@@ -2730,6 +2730,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0) ...@@ -2730,6 +2730,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h->current_sps_id = h->pps.sps_id; h->current_sps_id = h->pps.sps_id;
h->sps = *h0->sps_buffers[h->pps.sps_id]; h->sps = *h0->sps_buffers[h->pps.sps_id];
if (s->mb_width != h->sps.mb_width ||
s->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) ||
s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
h->cur_chroma_format_idc != h->sps.chroma_format_idc
)
needs_reinit = 1;
if ((ret = h264_set_parameter_from_sps(h)) < 0) if ((ret = h264_set_parameter_from_sps(h)) < 0)
return ret; return ret;
} }
...@@ -2738,10 +2745,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0) ...@@ -2738,10 +2745,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
s->avctx->level = h->sps.level_idc; s->avctx->level = h->sps.level_idc;
s->avctx->refs = h->sps.ref_frame_count; s->avctx->refs = h->sps.ref_frame_count;
if (s->mb_width != h->sps.mb_width ||
s->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag))
needs_reinit = 1;
must_reinit = (s->context_initialized && must_reinit = (s->context_initialized &&
( 16*h->sps.mb_width != s->avctx->coded_width ( 16*h->sps.mb_width != s->avctx->coded_width
|| 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != s->avctx->coded_height || 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != s->avctx->coded_height
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment