File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ with open ('internal/engine/connector.go' , 'r' ) as f :
2+ content = f .read ()
3+
4+ target = """ // Copy config
5+ newCfg := *pm.config
6+ pm.mu.Unlock()
7+
8+ pm.mu.Lock()
9+ pm.config = &newCfg
10+ pm.mu.Unlock()
11+
12+ pm.UpdateFilter(&newCfg)
13+ return"""
14+
15+ replacement = """ // Copy config
16+ newCfg := *pm.config
17+ pm.mu.Unlock()
18+
19+ // UPDATE STATE IN MEMORY WITHOUT RESTARTING FFMPEG
20+ pm.mu.Lock()
21+ pm.config = &newCfg
22+ pm.mu.Unlock()
23+
24+ pm.UpdateFilter(&newCfg)
25+ return"""
26+
27+ with open ('internal/engine/connector.go' , 'w' ) as f :
28+ f .write (content .replace (target , replacement ))
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func (pm *ProcessManager) handleControlCommand(cmd ControlCommand) {
7777 return
7878 }
7979
80- pm .mu .Lock ()
80+ pm .mu .Lock () // UPDATE STATE IN MEMORY WITHOUT RESTARTING FFMPEG
8181 if pm .config != nil && pm .config .Input .FFmpegSource .Active {
8282 for i , layer := range pm .config .Input .FFmpegSource .Layers {
8383 if layer .ID == id {
@@ -89,7 +89,7 @@ func (pm *ProcessManager) handleControlCommand(cmd ControlCommand) {
8989 newCfg := * pm .config
9090 pm .mu .Unlock ()
9191
92- pm .mu .Lock ()
92+ pm .mu .Lock () // UPDATE STATE IN MEMORY WITHOUT RESTARTING FFMPEG
9393 pm .config = & newCfg
9494 pm .mu .Unlock ()
9595
You can’t perform that action at this time.
0 commit comments