Remove mutex from MP4
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/AlexxIT/go2rtc/cmd/api"
|
"github.com/AlexxIT/go2rtc/cmd/api"
|
||||||
@@ -116,11 +115,8 @@ func handlerMP4(w http.ResponseWriter, r *http.Request) {
|
|||||||
Medias: core.ParseQuery(r.URL.Query()),
|
Medias: core.ParseQuery(r.URL.Query()),
|
||||||
}
|
}
|
||||||
|
|
||||||
mu := &sync.Mutex{}
|
|
||||||
cons.Listen(func(msg any) {
|
cons.Listen(func(msg any) {
|
||||||
if data, ok := msg.([]byte); ok {
|
if data, ok := msg.([]byte); ok {
|
||||||
mu.Lock()
|
|
||||||
defer mu.Unlock()
|
|
||||||
if _, err := w.Write(data); err != nil && exit != nil {
|
if _, err := w.Write(data); err != nil && exit != nil {
|
||||||
select {
|
select {
|
||||||
case exit <- err:
|
case exit <- err:
|
||||||
|
|||||||
Reference in New Issue
Block a user