Revision 5cdef40a libavcodec/pthread.c

View differences:

libavcodec/pthread.c
683 683
    FrameThreadContext *fctx;
684 684
    int i, err = 0;
685 685

  
686
    if (thread_count <= 1) {
687
        avctx->active_thread_type = 0;
688
        return 0;
689
    }
690

  
686 691
    avctx->thread_opaque = fctx = av_mallocz(sizeof(FrameThreadContext));
687 692

  
688 693
    fctx->threads = av_mallocz(sizeof(PerThreadContext) * thread_count);
......
882 887
        return -1;
883 888
    }
884 889

  
885
    avctx->thread_count = FFMAX(1, thread_count);
886

  
887 890
    if (avctx->codec) {
888 891
        validate_thread_parameters(avctx);
889 892

  

Also available in: Unified diff