summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-04 06:31:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-04 06:35:17 +0200
commit87f40364d1a22aff5c9c245fa4ad07275c954248 (patch)
tree4aec0853f83ac15ce8f299631505c145f48fe71e /libavcodec/mpegvideo.c
parente4e2db9c74a10b2342297489edc00e99b10d5eb3 (diff)
parentdc6632f1195c929a87ddf1b02d12b681c6de79ad (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits) build: simplify commands for clean target swscale: split swscale.c in unscaled and generic conversion routines. swscale: cosmetics. swscale: integrate (literally) swscale_template.c in swscale.c. swscale: split out x86/swscale_template.c from swscale.c. swscale: enable hScale_altivec_real. swscale: split out ppc _template.c files from main swscale.c. swscale: remove indirections in ppc/swscale_template.c. swscale: split out unscaled altivec YUV converters in their own file. mpegvideoenc: fix multislice fate tests with threading disabled. mpegts: Wrap #ifdef DEBUG and av_hex_dump_log() combination in a macro. build: Simplify texi2html invocation through the --output option. Mark some variables with av_unused Replace avcodec_get_pix_fmt_name() by av_get_pix_fmt_name(). svq3: Check negative mb_type to fix potential crash. svq3: Move svq3-specific fields to their own context. rawdec: initialize return value to 0. Remove unused get_psnr() prototype rawdec: don't leak option strings. bktr: get default framerate from video standard. ... Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index edc9e229fa..c599d1df3b 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -586,8 +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;
@@ -746,7 +745,7 @@ av_cold int MPV_common_init(MpegEncContext *s)
s->context_initialized = 1;
s->thread_context[0]= s;
- 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++){
@@ -778,7 +777,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]);
}