diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -301,14 +301,15 @@ int find_jobframe(struct distrenjob *hea found = 0; /* iterate through jobs from first to last */ for(distrenjob_ptr = head->next; (!found && !distrenjob_ptr) && !distrenjob_ptr->hibernate; distrenjob_ptr = distrenjob_ptr->next) - for(frame_counter = distrenjob_ptr->prev_frame_index; !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++) - if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED) + for(frame_counter = (distrenjob_ptr->prev_frame_index + 1); !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++) + if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED) // jobframe found { found = 1; your_job_type = distrenjob_ptr->type; distrenjob_ptr->frameset[frame_counter].status = FRAMESETSTATUS_ASSIGNED; distrenjob_ptr->frameset[frame_counter].start_time = clock(); distrenjob_ptr->assigned_frames++; + distrenjob_ptr->prev_frame_index = frame_counter; } if(!found)