diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 23:45:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 23:45:46 +0100 |
commit | 141b9d5c3b4d3dd4e9034ea73ed73f25cc0340e7 (patch) | |
tree | c3ad1141782c910b2e3f18109a2c29632c352eff | |
parent | fa7c08d5e192aea77fdfb7f52c44c196a3ba4452 (diff) | |
download | ffmpeg-141b9d5c3b4d3dd4e9034ea73ed73f25cc0340e7.tar.gz |
avcodec/h264_slice: update slice context linesizes when a new picture is allocated
previously they where only updated when decoding started and would thus have
been inconsistent for a longer period of time leaving more chances for
problems
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264_slice.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index fe773a5550..44000c7288 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -711,6 +711,11 @@ static int h264_frame_start(H264Context *h) if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) return ret; + for (i = 0; i < h->nb_slice_ctx; i++) { + h->slice_ctx[i].linesize = h->cur_pic_ptr->f.linesize[0]; + h->slice_ctx[i].uvlinesize = h->cur_pic_ptr->f.linesize[1]; + } + if (CONFIG_ERROR_RESILIENCE) { ff_er_frame_start(&h->slice_ctx[0].er); ff_h264_set_erpic(&h->slice_ctx[0].er.last_pic, NULL); |