]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.cpp
Add a UI toggle to turn off SRT at runtime.
[nageru] / nageru / mixer.cpp
index 2911dae1d19cc553846fbe66b8871b7c4dd6673c..3b7a99c0319ea567a0f5fcb38f17075ef9d7151d 100644 (file)
@@ -1615,7 +1615,6 @@ void Mixer::handle_hotplugged_cards()
 
 #ifdef HAVE_SRT
        // Same, for SRT inputs.
-       // TODO: On disconnect and reconnect, we might want to use the stream ID
        for (SRTSOCKET sock : hotplugged_srt_cards_copy) {
                char name[256];
                int namelen = sizeof(name);
@@ -2160,6 +2159,12 @@ void Mixer::start_srt()
                                }
                                break;
                        }
+                       if (!global_flags.enable_srt) {  // Runtime UI toggle.
+                               // Perhaps not as good as never listening in the first place,
+                               // but much simpler to turn on and off.
+                               srt_close(clientsock);
+                               continue;
+                       }
                        lock_guard<mutex> lock(hotplug_mutex);
                        hotplugged_srt_cards.push_back(clientsock);
                }