forked from FFmpeg/FFmpeg
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Force automatic thread_count to 1 for cbr mjpeg frame threading. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
1a5e8511d4
1 changed files with 8 additions and 0 deletions
|
@ -125,6 +125,14 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
|
|||
|| !(avctx->codec->capabilities & CODEC_CAP_INTRA_ONLY))
|
||||
return 0;
|
||||
|
||||
if( !avctx->thread_count
|
||||
&& avctx->codec_id == AV_CODEC_ID_MJPEG
|
||||
&& !(avctx->flags & CODEC_FLAG_QSCALE)) {
|
||||
av_log(avctx, AV_LOG_DEBUG,
|
||||
"Forcing thread count to 1 for MJPEG encoding, use -thread_type slice "
|
||||
"or a constant quantizer if you want to use multiple cpu cores\n");
|
||||
avctx->thread_count = 1;
|
||||
}
|
||||
if(!avctx->thread_count) {
|
||||
avctx->thread_count = av_cpu_count();
|
||||
avctx->thread_count = FFMIN(avctx->thread_count, MAX_THREADS);
|
||||
|
|
Loading…
Add table
Reference in a new issue