diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-07 19:38:23 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-07 19:38:23 +0200 |
commit | 8e6511c1e1fdd1ddd63cf609e8b981e5c811d4de (patch) | |
tree | 05380463334f71389af2c7adfc4444016226aa50 /libavcodec | |
parent | af2a17c09ad1324def0c3d6d8e8a2951ab9f8501 (diff) | |
download | ffmpeg-8e6511c1e1fdd1ddd63cf609e8b981e5c811d4de.tar.gz |
proresdec2: avoid VLA and use SliceContext instead.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/proresdec.h | 1 | ||||
-rw-r--r-- | libavcodec/proresdec2.c | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/proresdec.h b/libavcodec/proresdec.h index b3a81d5044..1c56227cbf 100644 --- a/libavcodec/proresdec.h +++ b/libavcodec/proresdec.h @@ -31,6 +31,7 @@ typedef struct { unsigned mb_y; unsigned mb_count; unsigned data_size; + int ret; } SliceContext; typedef struct { diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 0e32a97b16..cd487b2824 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -431,6 +431,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int int16_t qmat_chroma_scaled[64]; int mb_x_shift; + slice->ret = -1; //av_log(avctx, AV_LOG_INFO, "slice %d mb width %d mb x %d y %d\n", // jobnr, slice->mb_count, slice->mb_x, slice->mb_y); @@ -494,19 +495,20 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int qmat_chroma_scaled, log2_chroma_blocks_per_mb); } + slice->ret = 0; return 0; } static int decode_picture(AVCodecContext *avctx) { ProresContext *ctx = avctx->priv_data; - int i, threads_ret[ctx->slice_count]; + int i; - avctx->execute2(avctx, decode_slice_thread, NULL, threads_ret, ctx->slice_count); + avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count); for (i = 0; i < ctx->slice_count; i++) - if (threads_ret[i] < 0) - return threads_ret[i]; + if (ctx->slices[i].ret < 0) + return ctx->slices[i].ret; return 0; } |