Hi all,
just had a closer look at the issues I had with ejecting discs using
libcdio on OS X.
To eject, we scheduled the DADiskUnmount and DADiskEject commands and
then ran CFRunLoopRunInMode(kCFRunLoopDefaultMode, 30.0, TRUE); to
execute. This runs the current runloop until a connected source gets
signaled or it times out. The catch is that it stops on _any_ connected
source getting signaled which works fine for command line applications
where usually only our own source (dacontext.canceled) is attached to
the runloop. However, in Cocoa applications many other sources may be
connected to the same runloop and fire signals all the time. The
solution is to run that call in a loop until our source got signaled or
it timed out.
Another issue was in using kDADiskUnmountOptionDefault when unmounting.
This unmounted only the audio part when dealing with CD-Extra discs; the
data session stayed mounted and prevented the disc ejection. I changed
it to kDADiskUnmountOptionWhole to remedy.
Robert
----
Robert Kausch
[email protected]