BIG rewrite stream info

This commit is contained in:
Alex X
2024-06-15 16:46:03 +03:00
parent ecfe802065
commit 96504e2fb0
88 changed files with 1043 additions and 854 deletions
+8 -3
View File
@@ -4,14 +4,19 @@ import (
"io"
"net/url"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/mpegts"
)
func OpenURL(u *url.URL, body io.ReadCloser) (core.Producer, error) {
func OpenURL(u *url.URL, body io.ReadCloser) (*mpegts.Producer, error) {
rd, err := NewReader(u, body)
if err != nil {
return nil, err
}
return mpegts.Open(rd)
prod, err := mpegts.Open(rd)
if err != nil {
return nil, err
}
prod.FormatName = "hls/mpegts"
prod.RemoteAddr = u.Host
return prod, nil
}