AudioDeviceManager


#1

I gather things are supposed to keep playing when you call setAudioCallback( callback_pointer ) with a different callback_pointer than was there to begin with.

Either it “Disney Works” or I don’t.

1 initialisation is fine with callback#1 = works.
2 change to callback#2 = works.
3 change to callback#1 = disney works. no calling back.

SO put in some evil…

deviceManager_.setAudioCallback( callback_1 );
// [ perchance a wee sleep() in here? MORE EVIL ]
if ( ! deviceManager_.getCurrentAudioDevice()->isPlaying() )
	deviceManager_.getCurrentAudioDevice()->start( callback_1 );

now…

1 initialisation is fine with callback#1 = works.
2 change to callback#2 = works.
3 change to callback#1 (now with evil!) = works.
4 change to callback#2 (now with evil!) = disney works!!!

Any idea Jules before I launch a public enquiry?

ELP !!


#2

Hmm. Calling the device’s start() method will bugger things up, as you have to let the device manager look after that, so no surprise that your evil version fails.

But the callback swapping code is totally straightforward - I can’t see any potential problems there. Can you trace it into the AudioDeviceManager::CallbackHandler::audioDeviceIOCallback method and see where it goes?


#3