Commit 561d3a57 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_enc: Update the buffer size as more slices are merged

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e4c2ec87
...@@ -3733,6 +3733,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) ...@@ -3733,6 +3733,8 @@ static int encode_picture(MpegEncContext *s, int picture_number)
} }
s->avctx->execute(s->avctx, encode_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); s->avctx->execute(s->avctx, encode_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
for(i=1; i<context_count; i++){ for(i=1; i<context_count; i++){
if (s->pb.buf_end == s->thread_context[i]->pb.buf)
set_put_bits_buffer_size(&s->pb, FFMIN(s->thread_context[i]->pb.buf_end - s->pb.buf, INT_MAX/8-32));
merge_context_after_encode(s, s->thread_context[i]); merge_context_after_encode(s, s->thread_context[i]);
} }
emms_c(); emms_c();
......
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