mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-06 09:06:52 +08:00
重构媒体轨道等待逻辑
This commit is contained in:
@@ -97,14 +97,16 @@ func (r *Ring_Audio) Dispose() {
|
||||
}
|
||||
|
||||
// NextR 读下一个
|
||||
func (r *Ring_Audio) NextR() {
|
||||
func (r *Ring_Audio) NextR() bool {
|
||||
r.GoNext()
|
||||
r.Current.Wait()
|
||||
return r.Flag != 2 // 2代表已经销毁
|
||||
}
|
||||
|
||||
func (r *Ring_Audio) GetBuffer() *bytes.Buffer {
|
||||
if r.Current.Buffer == nil {
|
||||
r.Current.Buffer = bytes.NewBuffer([]byte{})
|
||||
r.Current.Payload = []byte{}
|
||||
r.Current.Buffer = bytes.NewBuffer(r.Current.Payload)
|
||||
} else {
|
||||
r.Current.Reset()
|
||||
}
|
||||
|
Reference in New Issue
Block a user