1 registered members (TipmyPip),
18,709
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Problem with media_play
#313735
03/03/10 07:55
03/03/10 07:55
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
Hi, I've got a problem with the following code:
var mHandle = media_play("..\\movies\\edsel_start.avi", NULL, musicVolume);
while(media_playing(mHandle) > 0) {
if (key_pressed(1)) {
media_stop(mHandle);
}
wait(1);
}
The game should wait until the avi is played or a key is pressed, but in one out of maybe 20 tries the movie is played and the code didn't wait for it. I also tried it like this:
var mHandle = media_play("..\\movies\\intro.avi", NULL, musicVolume);
wait(-2);
if (mHandle != 0) {
while(media_playing(mHandle) == 0) { // secure that avi is already playing
wait(1);
}
while(media_playing(mHandle) > 0) {
if (key_pressed(1)) {
media_stop(mHandle);
}
wait(1);
}
}
But it didn't help at all. I can reproduce it on different machines. Can someone help me what's wrong with that code? Regards, Pegamode.
|
|
|
Re: Problem with media_play
[Re: pegamode]
#313744
03/03/10 11:12
03/03/10 11:12
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
You can download a little test here: http://www.infinite-dreams.de/3dgs/media_play-issue.zipI could reproduce the problem after 6 tries using the current beta (but I had the same problem with former GS releases). The acklog.txt in the zip-file is the one when I produced the problem. I added a beep() and a logmessage after the code that should wait for media_playing(). So if you hear the beep right after starting the "game" you produced the problem. I hope this helps. Regards, Pegamode.
|
|
|
|