[PATCH 20/25] mciseq: Check stop condition after sleeping. (Try 3)
Joerg-Cyril.Hoehle at t-systems.com
Joerg-Cyril.Hoehle at t-systems.com
Thu Oct 11 02:37:15 CDT 2012
Hi,
Stop and Pause events will most often occur while the player is sleeping, not running.
Instead of playing a final note before aborting at the top of the loop,
check the conditions when waking up.
Now a local status = wmm->dwStatus cache is used. Incidentally, that's David Laight's suggestion too.
But it doesn't matter. The compiler may reload dwStatus 1, 2 or 3 times, it may spill status anytime,
it may eliminate the local status altogether, the code will just do what it reads:
+ status = wmm->dwStatus;
+ if (status == MCI_MODE_STOP || status == MCI_MODE_NOT_READY)
+ break;
+ if (status != MCI_MODE_PLAY)
+ continue;
STOP => abort
NOT_READY => abort
PLAY => play next note
As I mentioned, the player need not react immediately to status changes. The others are patiently
waiting if needed using WaitFor(hThread). All that matters is that the player eventually stops.
Regards,
Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mciseq-Check-stop-condition-after-sleeping.patch
Type: application/octet-stream
Size: 2341 bytes
Desc: 0001-mciseq-Check-stop-condition-after-sleeping.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20121011/d13cf54a/attachment.obj>
More information about the wine-patches
mailing list