Fix deadlock issues in dvr when recording is completed
This commit is contained in:
parent
de2071b10f
commit
b3cf7ff5cc
1 changed files with 6 additions and 4 deletions
|
@ -444,6 +444,8 @@ dvr_rec_stop(dvr_entry_t *de)
|
|||
if(st->st_status == ST_RUNNING) {
|
||||
st->st_status = ST_STOP_REQ;
|
||||
|
||||
pthread_cond_signal(&st->st_cond);
|
||||
|
||||
while(st->st_status != ST_ZOMBIE)
|
||||
pthread_cond_wait(&st->st_cond, &st->st_mutex);
|
||||
}
|
||||
|
@ -488,16 +490,16 @@ dvr_thread(void *aux)
|
|||
pthread_mutex_lock(&st->st_mutex);
|
||||
}
|
||||
|
||||
dvr_thread_epilog(de);
|
||||
|
||||
streaming_target_disconnect(&de->de_st);
|
||||
|
||||
/* Signal back that we no longer is running */
|
||||
st->st_status = ST_ZOMBIE;
|
||||
pthread_cond_signal(&st->st_cond);
|
||||
|
||||
pthread_mutex_unlock(&st->st_mutex);
|
||||
|
||||
dvr_thread_epilog(de);
|
||||
|
||||
streaming_target_disconnect(&de->de_st);
|
||||
|
||||
|
||||
pthread_mutex_lock(&global_lock);
|
||||
dvr_entry_dec_ref(de); /* Past this we may no longer
|
||||
|
|
Loading…
Add table
Reference in a new issue