Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,758 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: Problem with media_play [Re: pegamode] #317745
04/02/10 07:09
04/02/10 07:09
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I did some further tests and found out the following.

I changed my test script to this:

Code:
#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:

Code:
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 ...

Re: Problem with media_play [Re: pegamode] #317746
04/02/10 07:21
04/02/10 07:21
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Aaaaahhhhhh ...

I got it working ... it was just my stupid mistake.

Code:
while(media_playing(mHandle) > 0)



is totally wrong ... it must be

Code:
while(media_playing(mHandle) != 0)



what a stupid mistake ...

In all cases where I got the strange behaviour, media_playing returned a value < 0 ... that's all .... grrrrrr ....

Sorry for wasting your time.

Regards,
Pegamode.

Re: Problem with media_play [Re: pegamode] #326107
05/30/10 13:00
05/30/10 13:00
Joined: May 2010
Posts: 2
D
Delta Offline
Guest
Delta  Offline
Guest
D

Joined: May 2010
Posts: 2
I'm a newbie here. But I saw this topic by chance, and I've seen the problem here. Your code didn't work because your Direct X had not ready yet.

Try to put these lines in your code:
.....
video_screen = 2;
video_mode = 8;

//put these lines in your code:
level_load("");
wait(2);

on_esc = NULL;
.....

Your code will run correctly.

Thanks for paying attention to me.

Page 3 of 3 1 2 3

Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1