mirror of
https://github.com/Monibuca/plugin-hdl.git
synced 2025-10-04 00:16:39 +08:00
修复bug
This commit is contained in:
6
pull.go
6
pull.go
@@ -46,11 +46,11 @@ func PullStream(streamPath, url string) error {
|
|||||||
StreamPath: streamPath,
|
StreamPath: streamPath,
|
||||||
ExtraProp: &HDLPuller{},
|
ExtraProp: &HDLPuller{},
|
||||||
}
|
}
|
||||||
at := stream.NewAudioTrack(0)
|
|
||||||
vt := stream.NewVideoTrack(0)
|
|
||||||
if strings.HasPrefix(url, "http") {
|
if strings.HasPrefix(url, "http") {
|
||||||
if res, err := http.Get(url); err == nil {
|
if res, err := http.Get(url); err == nil {
|
||||||
if stream.Publish() {
|
if stream.Publish() {
|
||||||
|
at := stream.NewAudioTrack(0)
|
||||||
|
vt := stream.NewVideoTrack(0)
|
||||||
go func() {
|
go func() {
|
||||||
lastTs := pull(at, vt, res.Body, 0)
|
lastTs := pull(at, vt, res.Body, 0)
|
||||||
if config.Reconnect {
|
if config.Reconnect {
|
||||||
@@ -72,6 +72,8 @@ func PullStream(streamPath, url string) error {
|
|||||||
stream.Type = "FLV File"
|
stream.Type = "FLV File"
|
||||||
if file, err := os.Open(url); err == nil {
|
if file, err := os.Open(url); err == nil {
|
||||||
if stream.Publish() {
|
if stream.Publish() {
|
||||||
|
at := stream.NewAudioTrack(0)
|
||||||
|
vt := stream.NewVideoTrack(0)
|
||||||
go func() {
|
go func() {
|
||||||
lastTs := pull(at, vt, file, 0)
|
lastTs := pull(at, vt, file, 0)
|
||||||
if config.Reconnect {
|
if config.Reconnect {
|
||||||
|
Reference in New Issue
Block a user