Browse Source

Fix infinite loop in v4l2 plugin.

When initialization of the device fails the plugin may hang
trying to join a non-existing pthread.
fryshorts 11 năm trước cách đây
mục cha
commit
d73d2b22f8
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      plugins/linux-v4l2/v4l2-input.c

+ 1 - 0
plugins/linux-v4l2/v4l2-input.c

@@ -552,6 +552,7 @@ static void v4l2_terminate(struct v4l2_data *data)
 		os_event_signal(data->event);
 		os_event_signal(data->event);
 		pthread_join(data->thread, NULL);
 		pthread_join(data->thread, NULL);
 		os_event_destroy(data->event);
 		os_event_destroy(data->event);
+		data->thread = 0;
 	}
 	}
 
 
 	v4l2_destroy_mmap(&data->buffers);
 	v4l2_destroy_mmap(&data->buffers);