I did some further tests and found out the following.
I changed my test script to this:
#include <default.c>
#include <acknex.h> // Pure Mode
void main() {
video_screen = 2;
video_mode = 8;
var mHandle = media_play("intro_de.mpg", NULL, 100);
if (mHandle != 0) {
diag("\nmHandle != 0");
while(media_playing(mHandle) > 0) {
if (key_pressed(57)) {
diag("\nSpace was pressed ... stopping video.");
media_stop(mHandle);
}
wait(1);
}
} else {
diag("\nmHandle == 0");
}
beep();
diag("\navi isn't playing anymore.");
if (media_playing(mHandle) > 0) {
diag("\nmedia_playing(mHandle) > 0");
} else {
diag("\nmedia_playing(mHandle) == 0");
}
while(1) {
wait(1);
}
}
then I need 3 tries until the error occured and this is what the log wrote:
Main started at 2.282
D3D_Init Window: 1024x600 -> Window: 1x1024x600x32
Video memory found: 2191 MB
intro_de.mpg video/audio opened
mHandle != 0
avi isn't playing anymore.
media_playing(mHandle) > 0
def_startup started
Main loop at 3.326...
Server started at 3.331
Client started at 3.331.
1st frame with 2191 MB at 3.332
Normal exit at 13.021
Close level,DLL,objects
As you can see "media_playing(mHandle)" still returns a value > 0, but the while loop has been exited ?!?
So it seems as "media_playing" returned 0 and a few lines later it returns a value > 0 on the same handle ...