mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 06:40:15 +00:00
Use single should_exit flag.
This commit is contained in:
@@ -85,8 +85,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
static volatile bool should_exit_audio = false;
|
||||
|
||||
struct audio_device_t {
|
||||
int index;
|
||||
void *state;
|
||||
@@ -461,11 +459,6 @@ void audio_join(struct state_audio *s) {
|
||||
}
|
||||
}
|
||||
|
||||
void audio_finish()
|
||||
{
|
||||
should_exit_audio = true;
|
||||
}
|
||||
|
||||
void audio_done(struct state_audio *s)
|
||||
{
|
||||
if(s) {
|
||||
@@ -571,7 +564,7 @@ static void *audio_receiver_thread(void *arg)
|
||||
assert(pbuf_data.decoder != NULL);
|
||||
|
||||
printf("Audio receiving started.\n");
|
||||
while (!should_exit_audio) {
|
||||
while (!should_exit) {
|
||||
struct message *msg;
|
||||
while((msg= check_message(&s->audio_receiver_module))) {
|
||||
struct response *r = audio_receiver_process_message(s, (struct msg_receiver *) msg, pbuf_data.decoder);
|
||||
@@ -882,7 +875,7 @@ static void *audio_sender_thread(void *arg)
|
||||
audio_frame2_resampler resampler_state;
|
||||
|
||||
printf("Audio sending started.\n");
|
||||
while (!should_exit_audio) {
|
||||
while (!should_exit) {
|
||||
struct message *msg;
|
||||
while((msg= check_message(&s->audio_sender_module))) {
|
||||
struct response *r = audio_sender_process_message(s, (struct msg_sender *) msg);
|
||||
|
||||
@@ -73,7 +73,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void audio_start(struct state_audio *s);
|
||||
void audio_finish(void);
|
||||
void audio_done(struct state_audio *s);
|
||||
void audio_join(struct state_audio *s);
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ void *hd_rum_decompress_init(struct module *parent, bool blend, const char *capt
|
||||
void hd_rum_decompress_done(void *state) {
|
||||
struct state_transcoder_decompress *s = (struct state_transcoder_decompress *) state;
|
||||
|
||||
should_exit_receiver = true;
|
||||
should_exit = true;
|
||||
s->receiver_thread.join();
|
||||
|
||||
{
|
||||
|
||||
@@ -114,8 +114,6 @@ static void *writer(void *arg);
|
||||
static void signal_handler(int signal);
|
||||
void exit_uv(int status);
|
||||
|
||||
static volatile int should_exit = false;
|
||||
|
||||
/*
|
||||
* this is currently only placeholder to substitute UG default
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,7 @@ int uv_argc;
|
||||
char **uv_argv;
|
||||
|
||||
char *export_dir = NULL;
|
||||
volatile bool should_exit_receiver = false;
|
||||
volatile bool should_exit = false;
|
||||
|
||||
volatile int log_level = LOG_LEVEL_INFO;
|
||||
bool color_term = (getenv("TERM") && set<string>{"linux", "screen", "xterm", "xterm-256color"}.count(getenv("TERM")) > 0) && isatty(1) && isatty(2);
|
||||
|
||||
@@ -79,7 +79,7 @@ struct vidcap_params;
|
||||
extern int uv_argc;
|
||||
extern char **uv_argv;
|
||||
|
||||
extern volatile bool should_exit_receiver;
|
||||
extern volatile bool should_exit;
|
||||
|
||||
void exit_uv(int status);
|
||||
|
||||
|
||||
@@ -146,7 +146,6 @@ struct state_uv {
|
||||
};
|
||||
|
||||
static int exit_status = EXIT_SUCCESS;
|
||||
static volatile bool should_exit_sender = false;
|
||||
|
||||
static struct state_uv *uv_state;
|
||||
|
||||
@@ -175,10 +174,7 @@ static void crash_signal_handler(int sig)
|
||||
|
||||
void exit_uv(int status) {
|
||||
exit_status = status;
|
||||
|
||||
should_exit_sender = true;
|
||||
should_exit_receiver = true;
|
||||
audio_finish();
|
||||
should_exit = true;
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
@@ -292,7 +288,7 @@ static void *capture_thread(void *arg)
|
||||
|
||||
wait_obj = wait_obj_init();
|
||||
|
||||
while (!should_exit_sender) {
|
||||
while (!should_exit) {
|
||||
/* Capture and transmit video... */
|
||||
struct audio_frame *audio;
|
||||
struct video_frame *tx_frame = vidcap_grab(uv->capture_device, &audio);
|
||||
|
||||
@@ -152,7 +152,7 @@ static void vidcap_ug_input_done(void *state)
|
||||
{
|
||||
auto s = (ug_input_state *) state;
|
||||
|
||||
should_exit_receiver = true;
|
||||
should_exit = true;
|
||||
s->receiver_thread.join();
|
||||
|
||||
display_put_frame(s->display, NULL, 0);
|
||||
|
||||
@@ -87,7 +87,7 @@ void *ihdtv_video_rxtx::receiver_loop()
|
||||
|
||||
struct video_frame *frame_buffer = NULL;
|
||||
|
||||
while (!should_exit_receiver) {
|
||||
while (!should_exit) {
|
||||
frame_buffer = display_get_frame(m_display_device);
|
||||
if (ihdtv_receive
|
||||
(connection, frame_buffer->tiles[0].data, frame_buffer->tiles[0].data_len))
|
||||
|
||||
@@ -369,7 +369,7 @@ void *ultragrid_rtp_video_rxtx::receiver_loop()
|
||||
|
||||
fr = 1;
|
||||
|
||||
while (!should_exit_receiver) {
|
||||
while (!should_exit) {
|
||||
struct timeval timeout;
|
||||
/* Housekeeping and RTCP... */
|
||||
gettimeofday(&curr_time, NULL);
|
||||
|
||||
Reference in New Issue
Block a user