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
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,887 guests, and 6 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 1 of 3 1 2 3
Problem with media_play #313735
03/03/10 07:55
03/03/10 07:55
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi,

I've got a problem with the following code:

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:

Code:
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] #313741
03/03/10 10:37
03/03/10 10:37
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The first code looks ok to me. If the code doesn't wait, the only explanation that I see is that media_playing sometimes returns 0. Can you send that project to support? We must look into it deeper.

Re: Problem with media_play [Re: jcl] #313742
03/03/10 10:47
03/03/10 10:47
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'll try to reproduce it by copying the code into a little test game using the same avi as in the original game.

I think that makes it easier for you to take a look at instead of parsing the whole game-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 Offline OP
Serious User
pegamode  Offline 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.zip

I 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.

Re: Problem with media_play [Re: pegamode] #314398
03/08/10 11:59
03/08/10 11:59
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Have you been able to reproduce it?

Regards,
Pegamode.

Re: Problem with media_play [Re: pegamode] #314404
03/08/10 13:06
03/08/10 13:06
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Even worse: It does not even play with the DivX CODEC that I'm using, although I can play other DivX files. Which CODEC have you installed?

Re: Problem with media_play [Re: jcl] #314416
03/08/10 13:55
03/08/10 13:55
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 think I had a K-Lite-CODEC-Pack installed on Win XP.

On my Windows 7 machine I didn't install any CODEC just using the standard ones.

We used:

Format : AVI
Info : Audio Video Interleave
Family : RIFF
File size : 2.44 MiB
PlayTime : 12s 840ms
Writing application : Lavf50.6.0

Video #0
Codec : xvid
PlayTime : 12s 840ms
Width : 1024
Height : 768
Aspect ratio : 4/3
Frame rate : 25 fps

Audio #0
Codec : MPEG-1 Audio layer 3
Family : MPEG-1
Info : MPEG-1 or 2 layer 3
Codec profile : Joint stereo
PlayTime : 12s 868ms
Bit rate : 192 Kbps
Bit rate mode : CBR
Channel(s) : 2 channels
Sampling rate : 44 KHz
Resolution : 16

We also had the problem in this constellation:

Format : AVI
Info : Audio Video Interleave
Family : RIFF
File size : 15.3 MiB
PlayTime : 1mn 1s
Bit rate : 2099 Kbps

Video #0
Codec : XviD
Family : MPEG-4
Info : XviD project
PlayTime : 1mn 1s
Bit rate : 675 Kbps
Width : 1024
Height : 768
Aspect ratio : 4/3
Frame rate : 25 fps
Resolution : 8
Chroma : 4:2:0
Interlacement : Progressive
Bits/(Pixel*Frame) : 0.034
Writing library : Lavc52.34.0

Audio #0
Codec : PCM
Family : PCM
Info : Microsoft PCM
Bit rate : 1411 Kbps
Channel(s) : 2 channels
Sampling rate : 44 KHz
Resolution : 16

But I'm quite sure that we had the same also with a standard windows CODEC:

Format : AVI
Info : Audio Video Interleave
Family : RIFF
File size : 127 MiB
PlayTime : 55s 800ms
Bit rate : 19134 Kbps

Video #0
Codec : MS Video
Info : Microsoft Video 1
PlayTime : 55s 800ms
Bit rate : 18766 Kbps
Width : 1024
Height : 768
Aspect ratio : 4/3
Frame rate : 30 fps
Bits/(Pixel*Frame) : 0.795

Audio #0
Codec : ADPCM
Family : ADPCM
Info : Microsoft ADPCM
PlayTime : 57s 524ms
Bit rate : 355 Kbps
Channel(s) : 2 channels
Sampling rate : 44 KHz
Resolution : 4

But I'm not 100% sure with the last one.

Regards,
Pegamode.

Re: Problem with media_play [Re: pegamode] #314811
03/11/10 07:55
03/11/10 07:55
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Any news on this issue?

Regards,
Pegamode.

Re: Problem with media_play [Re: pegamode] #314822
03/11/10 11:17
03/11/10 11:17
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
No, I can't reproduce the problem here. But from the source code, I can see a scenario where a CODEC bug indeed leads to this problem. It happens when the CODEC erroneously triggers an event that marks the video as finished.

I can't fix this CODEC of course, but I've added a diagnostics output to the engine so that you can see if this is the reason.


Re: Problem with media_play [Re: jcl] #314825
03/11/10 11:31
03/11/10 11:31
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
That's good to hear.

Once we know where the problem comes from, we can fix it.

Page 1 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