fix: ffmpeg process not exit after program exit

This commit is contained in:
2024-10-25 03:41:48 +08:00
parent 6093f5d36b
commit 1c1028d857
3 changed files with 43 additions and 9 deletions

View File

@@ -109,10 +109,9 @@ func (s *Server) handleWebSocket(c *gin.Context) {
go func() {
ticker := time.NewTicker(1 * time.Second)
for range ticker.C {
currentVideoPath, _ := streamer.GlobalStreamer.GetCurrentVideoPath()
s.Broadcast(mywebsocket.Date{
Timestamp: time.Now().UnixMilli(),
CurrentVideoPath: currentVideoPath,
CurrentVideoPath: streamer.GlobalStreamer.GetCurrentVideoPath(),
VideoList: streamer.GlobalStreamer.GetVideoListPath(),
Output: streamer.GlobalStreamer.GetOutput(),
})