Skip to content

Commit 7c2f94b

Browse files
committed
oto: stop suspending and resuming when the machine is slept on macOS
This logic was introduced for hajimehoshi/ebiten#1259, but now this seems no longer needed. Rather, this logic caused unexpected resuming. Updates hajimehoshi/ebiten#3297
1 parent 5d55a31 commit 7c2f94b

File tree

3 files changed

+0
-118
lines changed

3 files changed

+0
-118
lines changed

driver_darwin.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import (
2121
"time"
2222
"unsafe"
2323

24-
"github.com/ebitengine/purego/objc"
25-
2624
"github.com/ebitengine/oto/v3/internal/mux"
2725
)
2826

@@ -140,11 +138,6 @@ func newContext(sampleRate int, channelCount int, format mux.Format, bufferSizeI
140138
c.audioQueue = q
141139
c.unqueuedBuffers = bs
142140

143-
if err := setNotificationHandler(); err != nil {
144-
c.err.TryStore(err)
145-
return
146-
}
147-
148141
var retryCount int
149142
try:
150143
if osstatus := _AudioQueueStart(c.audioQueue, nil); osstatus != noErr {
@@ -292,14 +285,6 @@ func render(inUserData unsafe.Pointer, inAQ _AudioQueueRef, inBuffer _AudioQueue
292285
theContext.cond.Signal()
293286
}
294287

295-
func setGlobalPause(self objc.ID, _cmd objc.SEL, notification objc.ID) {
296-
theContext.Suspend()
297-
}
298-
299-
func setGlobalResume(self objc.ID, _cmd objc.SEL, notification objc.ID) {
300-
theContext.Resume()
301-
}
302-
303288
func sleepTime(count int) time.Duration {
304289
switch count {
305290
case 0:

driver_ios.go

Lines changed: 0 additions & 24 deletions
This file was deleted.

driver_macos.go

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)