RTSP cap.: fixed init crash

Fixed a crash when init fails and done function is called - check if
threads that are to be destroyed were actually created.
This commit is contained in:
Martin Pulec
2022-04-29 09:30:54 +02:00
parent 5e57ec64ae
commit 13b3705098

View File

@@ -1027,8 +1027,12 @@ vidcap_rtsp_done(void *state) {
pthread_cond_signal(&s->keepalive_cv);
pthread_mutex_unlock(&s->lock);
pthread_join(s->vrtsp_state.vrtsp_thread_id, NULL);
pthread_join(s->keep_alive_rtsp_thread_id, NULL);
if (s->vrtsp_state.vrtsp_thread_id) {
pthread_join(s->vrtsp_state.vrtsp_thread_id, NULL);
}
if (s->keep_alive_rtsp_thread_id) {
pthread_join(s->keep_alive_rtsp_thread_id, NULL);
}
if(s->vrtsp_state.sd)
decompress_done(s->vrtsp_state.sd);