Revision dd9134c2

View differences:

libavcodec/w32thread.c
137 137

  
138 138
    s->active_thread_type= FF_THREAD_SLICE;
139 139

  
140
    if (thread_count <= 1)
140
    if (s->thread_count <= 1)
141 141
        return 0;
142 142

  
143 143
    assert(!s->thread_opaque);
144
    c= av_mallocz(sizeof(ThreadContext)*thread_count);
144
    c= av_mallocz(sizeof(ThreadContext)*s->thread_count);
145 145
    s->thread_opaque= c;
146 146
    if(!(c[0].work_sem = CreateSemaphore(NULL, 0, INT_MAX, NULL)))
147 147
        goto fail;
......
150 150
    if(!(c[0].done_sem = CreateSemaphore(NULL, 0, INT_MAX, NULL)))
151 151
        goto fail;
152 152

  
153
    for(i=0; i<thread_count; i++){
153
    for(i=0; i<s->thread_count; i++){
154 154
//printf("init semaphors %d\n", i); fflush(stdout);
155 155
        c[i].avctx= s;
156 156
        c[i].work_sem = c[0].work_sem;

Also available in: Unified diff