Commit 2483af97 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Don't clear n_tile_data on first dav1d_frame_task() iteration

Should fix hang in #23.
parent 44b748f4
......@@ -32,26 +32,22 @@
void *dav1d_frame_task(void *const data) {
Dav1dFrameContext *const f = data;
pthread_mutex_lock(&f->frame_thread.td.lock);
for (;;) {
pthread_mutex_lock(&f->frame_thread.td.lock);
f->n_tile_data = 0;
int did_signal = 0;
while (!f->n_tile_data && !f->frame_thread.die) {
if (!did_signal) {
did_signal = 1;
pthread_cond_signal(&f->frame_thread.td.cond);
}
pthread_cond_wait(&f->frame_thread.td.cond,
&f->frame_thread.td.lock);
}
if (f->frame_thread.die) {
pthread_mutex_unlock(&f->frame_thread.td.lock);
break;
}
if (f->frame_thread.die) break;
pthread_mutex_unlock(&f->frame_thread.td.lock);
dav1d_decode_frame(f);
pthread_mutex_lock(&f->frame_thread.td.lock);
f->n_tile_data = 0;
pthread_cond_signal(&f->frame_thread.td.cond);
}
pthread_mutex_unlock(&f->frame_thread.td.lock);
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment