summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-01-01 20:24:24 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-01-02 19:20:23 +0100
commit881a5e047dc78ec9ab771817497dffec503d77ee (patch)
tree0857c45d86537a7efe7c54dcbbe6b2d956b32861 /libavcodec/mpegvideo_enc.c
parent264808219d8be93aeda0b6ade8c64898b673f6bc (diff)
mpegenc: use avctx->slices as number of slices
Adds a new member to MpegEncContext to hold the number of used slice contexts. Fixes segfaults with '-threads 17 -thread_type slice' and fate-vsynth{1,2}-mpeg{2,4}thread{,_ilace} with --disable-pthreads.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index af303d80cd..84a5cdaac8 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1428,7 +1428,8 @@ int MPV_encode_picture(AVCodecContext *avctx,
{
MpegEncContext *s = avctx->priv_data;
AVFrame *pic_arg = data;
- int i, stuffing_count, context_count = avctx->thread_count;
+ int i, stuffing_count;
+ int context_count = s->slice_context_count;
for (i = 0; i < context_count; i++) {
int start_y = s->thread_context[i]->start_mb_y;
@@ -3059,7 +3060,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
{
int i;
int bits;
- int context_count = s->avctx->thread_count;
+ int context_count = s->slice_context_count;
s->picture_number = picture_number;