mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 06:40:26 +00:00
Video RXTX: hot-fixed locking
This commit is contained in:
@@ -222,9 +222,7 @@ void *video_rxtx::sender_loop() {
|
||||
|
||||
video_export(m_video_exporter, tx_frame.get());
|
||||
|
||||
if (!m_paused) {
|
||||
send_frame(tx_frame);
|
||||
}
|
||||
send_frame(tx_frame);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -128,13 +128,19 @@ struct response *rtp_video_rxtx::process_message(struct msg_sender *msg)
|
||||
}
|
||||
break;
|
||||
case SENDER_MSG_PAUSE:
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Paused.\n");
|
||||
m_paused = true;
|
||||
break;
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Paused.\n");
|
||||
m_paused = true;
|
||||
break;
|
||||
}
|
||||
case SENDER_MSG_PLAY:
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Playing again.\n");
|
||||
m_paused = false;
|
||||
break;
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Playing again.\n");
|
||||
m_paused = false;
|
||||
break;
|
||||
}
|
||||
case SENDER_MSG_CHANGE_FEC:
|
||||
{
|
||||
delete m_fec_state;
|
||||
|
||||
@@ -151,6 +151,10 @@ void ultragrid_rtp_video_rxtx::send_frame_async(shared_ptr<video_frame> tx_frame
|
||||
|
||||
int buffer_id = tx_get_buffer_id(m_tx);
|
||||
|
||||
if (m_paused) {
|
||||
goto after_send;
|
||||
}
|
||||
|
||||
if (m_connections_count == 1) { /* normal case - only one connection */
|
||||
tx_send(m_tx, tx_frame.get(),
|
||||
m_network_devices[0]);
|
||||
@@ -183,6 +187,7 @@ void ultragrid_rtp_video_rxtx::send_frame_async(shared_ptr<video_frame> tx_frame
|
||||
rtp_recv_r(m_network_devices[0], &timeout, ts);
|
||||
}
|
||||
|
||||
after_send:
|
||||
m_async_sending_lock.lock();
|
||||
m_async_sending = false;
|
||||
m_async_sending_lock.unlock();
|
||||
|
||||
Reference in New Issue
Block a user