Skip to content

Commit

Permalink
Reinit encoders with the mutexes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergystepanov committed Aug 11, 2024
1 parent 0232384 commit 8f859cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/worker/media/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (wmp *WebrtcMediaPipe) initAudio(srcHz int, frameSize int) error {
return fmt.Errorf("opus fail: %w", err)
}
wmp.log.Debug().Msgf("Opus: %v", au.GetInfo())
wmp.a = au
wmp.SetAudio(au)
buf := newBuffer(frame(srcHz, frameSize))
dstHz, _ := au.SampleRate()
if srcHz != dstHz {
Expand Down Expand Up @@ -198,7 +198,7 @@ func (wmp *WebrtcMediaPipe) initVideo(w, h int, scale float64, conf config.Video
if enc == nil {
return fmt.Errorf("broken video encoder init")
}
wmp.v = enc
wmp.SetVideo(enc)
wmp.log.Debug().Msgf("media scale: %vx%v -> %vx%v", w, h, sw, sh)
return err
}
Expand Down

0 comments on commit 8f859cd

Please sign in to comment.