summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-20 12:52:16 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-20 12:56:47 +0100
commita9275b4f6938ef5954a7c3d5b86787eac600611c (patch)
tree0563309df6a17f5e31a06dc756028b1a56391b0b
parent41135b7f64e699a71250b0c2082ba53b0338069a (diff)
h264: Fix code to also handle pix format changes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a44e7b6f55..a312325eb7 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2730,6 +2730,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h->current_sps_id = 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)
return ret;
}
@@ -2738,10 +2745,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
s->avctx->level = h->sps.level_idc;
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 &&
( 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