Revision ba9ef8d0 libavcodec/w32thread.c

View differences:

libavcodec/w32thread.c
125 125
    avcodec_thread_execute(s, NULL, arg, ret, count, 0);
126 126
}
127 127

  
128
int ff_thread_init(AVCodecContext *s, int thread_count){
128
int ff_thread_init(AVCodecContext *s){
129 129
    int i;
130 130
    ThreadContext *c;
131 131
    uint32_t threadid;
......
135 135
        return 0;
136 136
    }
137 137

  
138
    s->thread_count= thread_count;
139 138
    s->active_thread_type= FF_THREAD_SLICE;
140 139

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

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

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

Also available in: Unified diff