fix: snap plugin

This commit is contained in:
langhuihui
2025-04-02 16:19:03 +08:00
committed by dexter
parent 0914fb8da7
commit 4e46ecc8cd
7 changed files with 144 additions and 308 deletions

View File

@@ -4,14 +4,15 @@ import (
"context"
"encoding/base64"
"fmt"
"google.golang.org/protobuf/types/known/emptypb"
m7s "m7s.live/v5"
"net/url"
"os"
"path"
"strconv"
"strings"
"google.golang.org/protobuf/types/known/emptypb"
m7s "m7s.live/v5"
globalPB "m7s.live/v5/pb"
"m7s.live/v5/plugin/transcode/pb"
transcode "m7s.live/v5/plugin/transcode/pkg"
@@ -137,13 +138,8 @@ func parseCrop(cropString string) (string, error) {
func (t *TranscodePlugin) Launch(ctx context.Context, transReq *pb.TransRequest) (response *globalPB.SuccessResponse, err error) {
var publisher *m7s.Publisher
var ok bool
t.Server.Server.Call(func() error {
publisher, ok = t.Server.Streams.Get(transReq.SrcStream)
return nil
})
if !ok {
err = fmt.Errorf("src stream not found")
publisher, err = t.Server.GetPublisher(transReq.SrcStream)
if err != nil {
return
}
response = &globalPB.SuccessResponse{}