mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-25 13:48:49 +08:00
minor fix: data race for subtitle pointer
This commit is contained in:
parent
644c4fa695
commit
2b2523ee03
4
start.go
4
start.go
@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/gdamore/tcell/v2"
|
||||
@ -402,7 +403,10 @@ func start(application *tview.Application, args Args) {
|
||||
gomu.player.SetSongFinish(func(currAudio player.Audio) {
|
||||
|
||||
gomu.playingBar.subtitles = nil
|
||||
var mu sync.Mutex
|
||||
mu.Lock()
|
||||
gomu.playingBar.subtitle = nil
|
||||
mu.Unlock()
|
||||
if gomu.queue.isLoop {
|
||||
_, err = gomu.queue.enqueue(currAudio.(*player.AudioFile))
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user