Code refactoring after #859

This commit is contained in:
Alex X
2024-04-30 06:42:17 +03:00
parent 7a0646fd5f
commit 52832223f8
7 changed files with 55 additions and 96 deletions
+5
View File
@@ -19,6 +19,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/magic"
pkg "github.com/AlexxIT/go2rtc/pkg/rtsp"
"github.com/AlexxIT/go2rtc/pkg/shell"
"github.com/AlexxIT/go2rtc/pkg/stdin"
"github.com/rs/zerolog"
)
@@ -79,6 +80,10 @@ func execHandle(rawURL string) (core.Producer, error) {
}
func handlePipe(_ string, cmd *exec.Cmd, query url.Values) (core.Producer, error) {
if query.Get("backchannel") == "1" {
return stdin.NewClient(cmd)
}
r, err := PipeCloser(cmd, query)
if err != nil {
return nil, err