diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -308,22 +308,29 @@ blendjob[jobnum].frameset[frameset_count return your_frame; // your_frame is returned as the frame to be rendered } -void blend_frame_watchdog(){ - short int watchdog_forgiveness = 3; // Hours to wait on a frame before re-assigning it +void blend_frame_watchdog(struct blendjob *blendjob_head) +{ + unsigned short int watchdog_forgiveness; /*< seconds to wait on a frame before re-assigning it */ + struct blendjob *blendjob_ptr; + unsigned int counter; - int num1 = hcfjob + 1; + watchdog_forgiveness = 3 * 60 * 60; /*< 3hr in seconds */ + blendjob_ptr = blendjob_head; - while(num1 <= highest_jobnum){ // counts up through all the jobs - int num2 = 0; + for(blendjob_ptr = blendjob_head; blendjob_ptr; blendjob_ptr = blendjob_ptr->next) + /* iterate through jobs */ - while(num2 <= blendjob[num1].total_frames){ // Counts up through all the frames - if((blendjob[num1].frameset[num2].start_time + (watchdog_forgiveness * 3600)) < clock()) // If frame is not completed within the number of hours specified by watchdog_forgiveness - blendjob[num1].frameset[num2].frame_status = 0; // Then change the frame status to unassigned + for(counter = 0; counter < blendjob_ptr->total_frames; counter ++) + /* iterate through all frames for this job*/ + { + if((blendjob_ptr->frameset[counter].start_time + (watchdog_forgiveness * 3600)) < clock()) + /* + If frame is not completed within the number of hours specified by watchdog_forgiveness + Then change the frame status to unassigned + */ + blendjob_ptr->frameset[counter].frame_status = 0; + } - num2++; - } - num1++; - } }