diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-02 14:24:58 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-03 09:52:09 -0700 |
commit | 83a8b3002f3399c52b3900ca2f068d51e97713ec (patch) | |
tree | b9cec79ff98733b7427eb741d7f79d313998a795 /libavcodec/mpegvideo.c | |
parent | 43b6c3eb182617ff08e72584e1c4635ac20d33e8 (diff) | |
download | ffmpeg-83a8b3002f3399c52b3900ca2f068d51e97713ec.tar.gz |
mpegvideoenc: fix multislice fate tests with threading disabled.
The MPEG encoding code assumes that n_threads == n_slices, and thus it
should use n_slices even if threading itself is disabled.
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index dfb2289201..6a45da8761 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -586,7 +586,7 @@ av_cold int MPV_common_init(MpegEncContext *s) return -1; } - if((s->avctx->active_thread_type & FF_THREAD_SLICE) && + if((s->encoding || (s->avctx->active_thread_type & FF_THREAD_SLICE)) && (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height))){ av_log(s->avctx, AV_LOG_ERROR, "too many threads\n"); return -1; @@ -750,7 +750,7 @@ av_cold int MPV_common_init(MpegEncContext *s) s->thread_context[0]= s; if (s->width && s->height) { - if (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_SLICE) { + if (s->encoding || (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_SLICE)) { threads = s->avctx->thread_count; for(i=1; i<threads; i++){ @@ -782,7 +782,7 @@ void MPV_common_end(MpegEncContext *s) { int i, j, k; - if (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_SLICE) { + if (s->encoding || (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_SLICE)) { for(i=0; i<s->avctx->thread_count; i++){ free_duplicate_context(s->thread_context[i]); } |