Skip to content

Commit 6d05147

Browse files
committed
another fixes
flush the messages from sender whe exitting This will now supporess the warning about non-free message queue when running `/uv -x sdp:help` (the message is sent by tx to initialize fec but not dispatched). + add the assertion for msg in msg processing in vcompress (CHANGE_COMPRESS is not be explicitly referenced anywhere otherwise)
1 parent 26f5bd6 commit 6d05147

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/video_compress.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static void compress_process_message(struct compress_state *proxy, struct msg_ch
174174
}
175175

176176
} else {
177+
assert(data->what == CHANGE_COMPRESS);
177178
struct compress_state_real *new_state;
178179
char config[1024];
179180
strncpy(config, data->config_string, sizeof(config));

src/video_rxtx.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ video_rxtx::video_rxtx(const char *protocol_name,
117117
pthread_mutex_init(&m_lock, nullptr);
118118
}
119119

120+
static void flush_messages(struct module *mod) {
121+
struct message *m = nullptr;
122+
while ((m = check_message(mod)) != nullptr) {
123+
free_message(m, nullptr);
124+
}
125+
}
126+
120127
video_rxtx::~video_rxtx() noexcept
121128
{
122129
join();
@@ -127,6 +134,7 @@ video_rxtx::~video_rxtx() noexcept
127134
m_impl_funcs->done(m_impl_state);
128135
compress_done(m_compression);
129136
module_done(&m_receiver_mod);
137+
flush_messages(&m_sender_mod);
130138
module_done(&m_sender_mod);
131139

132140
pthread_mutex_destroy(&m_lock);

0 commit comments

Comments
 (0)