mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
do not panic if capture pipeline already exists.
This commit is contained in:
parent
51577ecff4
commit
41d8fa7e22
@ -1,6 +1,7 @@
|
|||||||
package capture
|
package capture
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -141,20 +142,23 @@ func (manager *CaptureManagerCtx) Start() {
|
|||||||
manager.desktop.OnAfterScreenSizeChange(func() {
|
manager.desktop.OnAfterScreenSizeChange(func() {
|
||||||
for _, video := range manager.videos {
|
for _, video := range manager.videos {
|
||||||
if video.Started() {
|
if video.Started() {
|
||||||
if err := video.createPipeline(); err != nil {
|
err := video.createPipeline()
|
||||||
|
if err != nil && !errors.Is(err, types.ErrCapturePipelineAlreadyExists) {
|
||||||
manager.logger.Panic().Err(err).Msg("unable to recreate video pipeline")
|
manager.logger.Panic().Err(err).Msg("unable to recreate video pipeline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if manager.broadcast.Started() {
|
if manager.broadcast.Started() {
|
||||||
if err := manager.broadcast.createPipeline(); err != nil {
|
err := manager.broadcast.createPipeline()
|
||||||
|
if err != nil && !errors.Is(err, types.ErrCapturePipelineAlreadyExists) {
|
||||||
manager.logger.Panic().Err(err).Msg("unable to recreate broadcast pipeline")
|
manager.logger.Panic().Err(err).Msg("unable to recreate broadcast pipeline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if manager.screencast.Started() {
|
if manager.screencast.Started() {
|
||||||
if err := manager.screencast.createPipeline(); err != nil {
|
err := manager.screencast.createPipeline()
|
||||||
|
if err != nil && !errors.Is(err, types.ErrCapturePipelineAlreadyExists) {
|
||||||
manager.logger.Panic().Err(err).Msg("unable to recreate screencast pipeline")
|
manager.logger.Panic().Err(err).Msg("unable to recreate screencast pipeline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user