diff --git a/cmd/mxl-player/main.go b/cmd/mxl-player/main.go index 6e5af7a..8f0fa77 100644 --- a/cmd/mxl-player/main.go +++ b/cmd/mxl-player/main.go @@ -243,7 +243,7 @@ func main() { switch { case args.VideoFlowId != "" && args.AudioFlowId != "": - syncSrc, err = source.OpenSync(args.Domain, args.VideoFlowId, args.AudioFlowId) + syncSrc, err = source.OpenSameDomainSync(args.Domain, args.VideoFlowId, args.AudioFlowId) if err != nil { log.Fatalf("sync source: %v", err) } @@ -378,7 +378,7 @@ func main() { // Try once. Return error if fails — caller loops back to select // and can pick up new reconnect params or a new grant. if params.video != "" && params.audio != "" { - s, e := source.OpenSync(params.domain, params.video, params.audio) + s, e := source.OpenSameDomainSync(params.domain, params.video, params.audio) if e == nil { if r != nil { newSize := vk.DeviceSize(s.Stride()) * vk.DeviceSize(s.Height()) diff --git a/internal/source/source.go b/internal/source/source.go index 5f34696..e5186f0 100644 --- a/internal/source/source.go +++ b/internal/source/source.go @@ -305,7 +305,10 @@ type SyncSource struct { width, height, stride uint32 } -func OpenSync(domain, videoFlow, audioFlow string) (*SyncSource, error) { +// OpenSameDomainSync opens a native MXL synchronization group. +// Both feeds must belong to the supplied domain because go-mxl sync groups +// cannot contain readers from different MXL instances. +func OpenSameDomainSync(domain, videoFlow, audioFlow string) (*SyncSource, error) { inst, err := mxl.NewInstance(domain, "") if err != nil { return nil, fmt.Errorf("NewInstance: %w", err)