This is no longer necessary given that the MPEG-1 encoder now adapts the size of the last slice to ensure that no slice header has an invalid slice_start_code.
Unified · Split
| @@ -115,12 +115,6 @@ av_cold int ff_slice_thread_init(AVCodecContext *avctx) · 114 unmodified lines | |||
| 115 | int thread_count = avctx->thread_count; | 115 | int thread_count = avctx->thread_count; |
| 116 | void (*mainfunc)(void *); | 116 | void (*mainfunc)(void *); |
| 117 | 117 | ||
| 118 | // We cannot do this in the encoder init as the threads are created before | ||
| 119 | if (ff_codec_is_encoder(avctx->codec) && | ||
| 120 | avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && | ||
| 121 | avctx->height > 2800) | ||
| 122 | thread_count = avctx->thread_count = 1; | ||
| 123 | |||
| 124 | if (!thread_count) { | 118 | if (!thread_count) { |
| 125 | int nb_cpus = av_cpu_count(); | 119 | int nb_cpus = av_cpu_count(); |
| 126 | if (avctx->height) | 120 | if (avctx->height) |