Jump to content

LETheora Crashing at Create Clip


Shard
 Share

Recommended Posts

I've been trying to integrate the LETheora library into my project and play the bunny video. It all complies fine and everything until I go to use the manager to create a clip when I get this error:

 

Unhandled exception at 0x6bd8ae7a in Zero Hour.exe: 0xC0000005: Access violation reading location 0xcccccccc.

 

 

//Media.h

Media
{
TheoraVideoClip *clip;
TheoraVideoManager *manager;

float w;
float h;

float tw;
float th;

TBuffer testbuffer;
TTexture testtexture;
TMaterial testmaterial;
};

 

//Media Init

void Media::Initialize()
{
manager = new TheoraVideoManager();
}

 

//Play Video

void Media::PlayVideo(string &nonAbstractFileName)
{
nonAbstractFileName = "abstract::" + nonAbstractFileName;
nonAbstractFileName = AbstractPath(str(nonAbstractFileName.c_str()));

this->clip = manager->createVideoClip(nonAbstractFileName, TH_RGB, 0, 1); //<-----breaks here, note that the file name is perfectly fine and finds the video without a problem.
this->clip->setAutoRestart(false);

float w=clip->getWidth(),h=clip->getHeight();
float tw=nextPow2(w),th=nextPow2(h);

testbuffer = CreateBuffer(tw,th,BUFFER_COLOR);
testtexture = CreateTexture(tw,th,TEXTURE_RGB);
testmaterial = LoadMaterial("abstract::video.mat");
TextureFilter(testtexture, TEXFILTER_PIXEL);
SetMaterialTexture(testmaterial, testtexture);

       ....

}

 

 

The error seems to occur when I go into the CreateClip function.

 

Can anyone make a guess as to whats going on?

 

Do I need to upload a copy of a simple version of this for you to test out? (It'll take a little bit but it can be done)

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Attached is the project file.

 

Please note that this includes my solution files so you may have to relink the engine/leo cpp files depending on your directory structure.

 

Edit: It seems I forgot to include the shader.pak and the video.mat files. Please toss this in. My apologies. (These are included in the project, just forgot to import them into the upload)

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Hmmm, guess i had better luck with it - it only crashed once at me while the lua script couldnt find the surface i was pointing to iirc.

I dont have it right here atm and cant test - you do used the TV model to test, right ?

 

here is the content of my video.mat ;)

 

blend=0
depthmask=1
depthtest=1
overlay=0
zsort=0
cullface=1
castshadows=1
specular=1.00000000
bumpscale=1.00000000
gloss=0.500000000
shader="abstract::mesh_diffuse.vert","abstract::mesh_video.frag"
shadowshader="abstract::mesh_shadow.vert",""

 

hth

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Hmmm, guess i had better luck with it - it only crashed once at me while the lua script couldnt find the surface i was pointing to iirc.

I dont have it right here atm and cant test - you do used the TV model to test, right ?

 

here is the content of my video.mat ;)

 

blend=0
depthmask=1
depthtest=1
overlay=0
zsort=0
cullface=1
castshadows=1
specular=1.00000000
bumpscale=1.00000000
gloss=0.500000000
shader="abstract::mesh_diffuse.vert","abstract::mesh_video.frag"
shadowshader="abstract::mesh_shadow.vert",""

 

hth

 

 

No I'm doing it in C++, so I'm actually drawing the texture to the screen, because I don't paint anything with it.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

You need to quote that little bit of a hint. ;)

Anyways, thats the point - if you render to a custom buffer why the call ... another thing is that you pass the video file before you init your "TheoraVideoManager" iirc. (is this correct?)

 

Dont have the source here at work but its giving me a badPointer on "customBuffer".

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Couple of things that came to mind:

- try a release build instead of debug (you linked to non debug libs..)

- in main.cpp first call media::initialize() and then media::playvideo("bunny.ogg")

- comment out the first two lines in playvideo() method, if you're calling playvideo("bunny.ogg"), and execute from the same dir as the dll and video file (just to be sure it's not a path problem)

Link to comment
Share on other sites

Couple of things that came to mind:

- try a release build instead of debug (you linked to non debug libs..)

- in main.cpp first call media::initialize() and then media::playvideo("bunny.ogg")

- comment out the first two lines in playvideo() method, if you're calling playvideo("bunny.ogg"), and execute from the same dir as the dll and video file (just to be sure it's not a path problem)

 

1) Didn't work, got this message

Windows has triggered a breakpoint in Zero Hour.exe.

 

This may be due to a corruption of the heap, which indicates a bug in Zero Hour.exe or any of the DLLs it has loaded.

 

This may also be due to the user pressing F12 while Zero Hour.exe has focus.

 

The output window may have more diagnostic information.

 

2) I have been doing that

 

3) Have been doing that.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

I've made you a very minimal & basic example of playing ogg video with sound.. just 2 things to keep in mind:

- it's meant for 2d fullframe video playback (if you want on 3d surfaces, just create a material and paint the mesh)

- video must be pow2 friendly (i see you already have some code to remedy this)

Link to comment
Share on other sites

I've made you a very minimal & basic example of playing ogg video with sound.. just 2 things to keep in mind:

- it's meant for 2d fullframe video playback (if you want on 3d surfaces, just create a material and paint the mesh)

- video must be pow2 friendly (i see you already have some code to remedy this)

 

 

You sir are a savior.

 

Thank you very much for this. I'll be able to figure out the missing components from this.

 

I think you should upload this to the downloads section, right next to LETheora so people who have questions in the future can look at this.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

So it seems that I've found a problem.

 

Your code works perfectly fine in VS2008 but crashes at the same location in VS2010.

 

Do you know what might be causing this? Would this have something to do with some configuration?

 

Can you test it in VS2010?

 

I can't really revert to 2008 as it would be a lot of trouble so if you would know what would solve this, I would be even more grateful.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

You can try compiling your project with VS2008 from VS2010. Open up your project settings and go to "General". Then set the "Platform Toolset" to "vs90". You will need to have VS2008 (express will be fine) installed.

 

Cheers!

Link to comment
Share on other sites

You can try compiling your project with VS2008 from VS2010. Open up your project settings and go to "General". Then set the "Platform Toolset" to "vs90". You will need to have VS2008 (express will be fine) installed.

 

Cheers!

 

You sir have just done magic! Or Science. Take your pick :)

 

It work marvelously now.

 

Now on to the question of how one converts an avi into ogg. Any idea? How do you guys do it? I have been unable to find a converter that converts an ogg with video. They all do audio.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

I use erightsoft SUPER and it works great for me (with audio) ..

 

What settings do you use for it? I've included screencaps of my default settings. The second screencap is the video not running in your code and the last screen cap is the video running in VLC player.

 

 

Best of luck with your deadline 

Thank you. Please be sure to sign up for the beta if you haven't at http://3rdinitiative.com/system/

post-26-12755235281139_thumb.jpg

post-26-12755235297106_thumb.jpg

post-26-12755235313491_thumb.jpg

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Its not completely testet but i would stay HD (also for audio) - since my older compressed clips are simply refusing to work.

In Niosop´s post is some bit for "preventing spikes" which did it for one of them "samples". :P However, others are crashing because of sound or strange pixel size "width/height" like 533x387.

 

thx for your openAL addon paramecij. :) Can we "stream" that to use Le`s audio functions ?!

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

What settings do you use for it? I've included screencaps of my default settings. The second screencap is the video not running in your code and the last screen cap is the video running in VLC player.

 

I basically use the same settings, .. you'll have to create a power of 2 texture (you already used niosop's code for that in your example) and the code to prevent 'spikes' ..

 

Can we "stream" that to use Le`s audio functions ?!

I don't see a way for that :)

Link to comment
Share on other sites

I basically use the same settings, .. you'll have to create a power of 2 texture (you already used niosop's code for that in your example) and the code to prevent 'spikes' ..

 

 

Thanks for that. The video is showing now, but there is no sound. What do I do about that? The sound works fine in VLC.

 

Heres the code:

 

//	====================================================================
//	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
//	Written by Rimfrost Software
//	http://www.rimfrost.com 
//	====================================================================
#pragma comment(lib,"libtheoraplayer.lib")
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"openal32.lib")

#include <windows.h>
#include "engine.h"
#include <gl/gl.h>
#include "TheoraVideoManager.h"
#include "TheoraVideoFrame.h"
#include "OpenAL_AudioInterface.h"

int nextPow2(int x)
{
int y;
for (y=1;y<x;y*=2);
return y;
}

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) 
{

Initialize() ;
SetAppTitle( "hello_video" ) ;
Graphics( 1024, 600 ) ;

TWorld	world;
TBuffer gbuffer;
TCamera camera;

world = CreateWorld() ;
gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
camera=CreateCamera();


// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
TheoraVideoManager *mgr = new TheoraVideoManager();
OpenAL_AudioInterfaceFactory *iface_factory=new OpenAL_AudioInterfaceFactory();
mgr->setAudioInterfaceFactory(iface_factory);
mgr->setDefaultNumPrecachedFrames(32);

//TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1);
TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1);
clip->setAutoRestart(1);
float w=clip->getWidth();
float h=clip->getHeight();
float tw = nextPow2(w),th=nextPow2(h);

TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB );
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP

 unsigned long time=GetTickCount();                
 unsigned long t=time;

// Game loop
while( !KeyHit() && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{		

		// THEORA CODE UPDATE TEXTURE 
		// THEORA CODE UPDATE TEXTURE  
		TheoraVideoFrame *f = clip->getNextFrame();
		if(f)
		{
			BindTexture(videotexture);
			glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() );
			clip->popFrame();
		}
		//mgr->update(AppSpeed());
		// THEORA CODE UPDATE TEXTURE

		t=GetTickCount();
		float diff=(t-time)/1000.0f; 
		if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load)                                
		mgr->update(diff);
		time=t;


		// Update timing and world
		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		// Render
		SetBuffer(gbuffer);
		RenderWorld();
		SetBuffer(BackBuffer());
		RenderLights(gbuffer);

		// THEORA "PLAYBACK" 
		// THEORA "PLAYBACK" 
		DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() );

		// Send to screen
		Flip(0) ;
	}
}

// Done
return Terminate() ;
}

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Hmm sound works for me - in bunny.ogg and my own transcoded file, don't know if this will help but I attached a screenshot from the settings I used in SUPER

 

 

Thanks, changing the bitrate to 128 fixed the problem but created a new one. (of course >,>)

 

The audio files we have play at 96kbps so when the this->iface_factory = new OpenAL_AudioInterfaceFactory(); is set it plays the audio files faster to compensate for the speed.

 

Is there some way to set the playback speed of video files? The other options for me would be to increase the audio files to 128 or set and unset the iface every time I play and finish a video.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

hmmm, i just use "ffmpeg2theora-0.25.exe" since super comes with a "non-commericial" license (just for the gui) with following settings, no issues so far

 

ffmpeg2theora-0.25.exe --noaudio trailer.ogg
ffmpeg2theora-0.25.exe -v9 -x960 -y720 -a2 -A80 -H44100 trailer.ogg
ffmpeg2theora-0.25.exe -x960 -y720 -A80 -H44100 HountedHill.flv

 

resampling audio seams to be very expensive, so if one has to -a1 (the default) should be better. -A80 is for Kbps but calling the exe under "cmd" shows the possible switches - there is also a "sync" switch.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

So it seems that something is wrong with my Media class because I can play the video when I put your code into my main and run it but when I try to run it through my media class, it always crashes at the same location, the CreateClip function T_T

 

 

Please take a look at my media class and tell me what I'm doing wrong with it.

 

// Header File

#pragma once

#pragma comment(lib,"libtheoraplayer.lib")
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"openal32.lib")

#include "Include.h"

#include <windows.h>
#include "engine.h"
#include <gl/gl.h>
#include "TheoraVideoManager.h"
#include "TheoraVideoFrame.h"
#include "OpenAL_AudioInterface.h"


class Media
{

private:
int nextPow2(int x);

TheoraVideoClip *clip;
TheoraVideoManager *manager;
OpenAL_AudioInterfaceFactory *iface_factory;

float w;
float h;

float tw;
float th;

TBuffer testbuffer;
TTexture testtexture;
TMaterial testmaterial;

public:

bool eax;
Framework *frameWork;


Media();

void PlaySoundFile(string &nonAbstractFileName, bool loop = false, float volume = 10);
void PlaySoundFile(TSound &sound, float volume = 10, bool loop = false);
void PlaySoundSource(TSource &source, float volume = 10, bool loop = false);

TSource LoadSoundFile(string fileName);

void PlayVideo(string &nonAbstractFileName, bool autoRestart = false,  bool skippable = true);
void PlayVideo(TheoraVideoClip *clip, bool skippable = true);

TheoraVideoClip* LoadVideo(string &fileName, bool autoRestart = false);

void Update();
void Initialize();
};

 

 

 

//CPP

#include "Media.h"


Media::Media()
{
clip = NULL;
manager = NULL;

}

void Media::PlaySoundFile(string &nonAbstractFileName, bool loop, float volume)
{
nonAbstractFileName = "abstract::" + nonAbstractFileName;
TSound sound = LoadSound(str(nonAbstractFileName.c_str()));
PlaySoundFile(sound,loop,volume);
}

void Media::PlayVideo(string &nonAbstractFileName, bool autoRestart, bool skippable)
{
nonAbstractFileName = "abstract::" + nonAbstractFileName;
nonAbstractFileName = AbstractPath(str(nonAbstractFileName.c_str()));

this->clip = LoadVideo(nonAbstractFileName,autoRestart);
PlayVideo(this->clip,skippable);
}

TheoraVideoClip* Media::LoadVideo(string &fileName, bool autoRestart)
{
TheoraVideoClip *clip = manager->createVideoClip(fileName, TH_RGB, 0, 1);
clip->setAutoRestart(autoRestart);

return clip;
}

void Media::PlayVideo(TheoraVideoClip *clip, bool skippable)
{

float w = clip->getWidth();
float h = clip->getHeight();

float tw = nextPow2(w);
float th = nextPow2(h);

TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB );

TheoraVideoFrame* f = clip->getNextFrame();

unsigned long time = GetTickCount();
unsigned long t = time;

bool exitVideo = true;

while(f || exitVideo == true)
{
	TheoraVideoFrame *f = clip->getNextFrame();

	if(f)
	{
		BindTexture(videotexture);
		glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() );
		clip->popFrame();
	}

	t=GetTickCount();
	float diff=(t-time)/1000.0f; 
	if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load)                                
	manager->update(diff);
	time=t;

	// Update timing and world
	UpdateAppTime();
	UpdateWorld(AppSpeed()) ;

	// Render
	frameWork->Update();
	frameWork->Render();


	DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() );

	// Send to screen
	Flip(0) ;


}
}

void Media::PlaySoundFile(TSound &sound, float volume, bool loop)
{
TSource source;

if(!loop) source = CreateSource(sound);
else source = CreateSource(sound,SOURCE_LOOP);

PlaySoundSource(source);
}

void Media::PlaySoundSource(TSource &source, float volume, bool loop)
{
volume = Clamp(volume,0,10);

PlaySource(source);
SetSourceVolume(source,volume);

FreeSource(source);
}

TSource Media::LoadSoundFile(string fileName)
{
fileName = "abstract::" + fileName;

TSound sound = LoadSound(str(fileName.c_str()));
TSource source = CreateSource(sound);

return source;
}

void Media::Update()
{

}

int Media::nextPow2(int x)
{
int y;
for (y=1;y<x;y*=2);
return y;
}

void Media::Initialize()
{
manager = new TheoraVideoManager();
this->iface_factory = new OpenAL_AudioInterfaceFactory();

manager->setAudioInterfaceFactory(iface_factory);
manager->setDefaultNumPrecachedFrames(32);

}

 

 

//Usage

Media *media = new Media;

media->Initialize();
media->frameWork = [frameWork Reference];

string vid = "bunny.ogg";
media->PlayVideo(vid);

 

 

//This Works Fine

//	====================================================================
//	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
//	Written by Rimfrost Software
//	http://www.rimfrost.com 
//	====================================================================
#pragma comment(lib,"libtheoraplayer.lib")
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"openal32.lib")

#include <windows.h>
#include "engine.h"
#include <gl/gl.h>
#include "TheoraVideoManager.h"
#include "TheoraVideoFrame.h"
#include "OpenAL_AudioInterface.h"

int nextPow2(int x)
{
int y;
for (y=1;y<x;y*=2);
return y;
}

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) 
{

Initialize() ;
SetAppTitle( "hello_video" ) ;
Graphics( 1024, 600 ) ;

TWorld	world;
TBuffer gbuffer;
TCamera camera;

world = CreateWorld() ;
gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
camera=CreateCamera();


// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
TheoraVideoManager *mgr = new TheoraVideoManager();
OpenAL_AudioInterfaceFactory *iface_factory=new OpenAL_AudioInterfaceFactory();
mgr->setAudioInterfaceFactory(iface_factory);
mgr->setDefaultNumPrecachedFrames(32);

//TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1);
TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1);
clip->setAutoRestart(1);
float w = clip->getWidth();
float h = clip->getHeight();
float tw = nextPow2(w);
float th = nextPow2(h);

TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB );
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP
// THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP

 unsigned long time=GetTickCount();                
 unsigned long t=time;

// Game loop
while( !KeyHit() && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{		

		// THEORA CODE UPDATE TEXTURE 
		// THEORA CODE UPDATE TEXTURE  
		TheoraVideoFrame *f = clip->getNextFrame();
		if(f)
		{
			BindTexture(videotexture);
			glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() );
			clip->popFrame();
		}
		//mgr->update(AppSpeed());
		// THEORA CODE UPDATE TEXTURE

		t=GetTickCount();
		float diff=(t-time)/1000.0f; 
		if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load)                                
		mgr->update(diff);
		time=t;


		// Update timing and world
		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		// Render
		SetBuffer(gbuffer);
		RenderWorld();
		SetBuffer(BackBuffer());
		RenderLights(gbuffer);

		// THEORA "PLAYBACK" 
		// THEORA "PLAYBACK" 
		DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() );

		// Send to screen
		Flip(0) ;
	}
}

// Done
return Terminate() ;
}

 

Why isn't it working D:<

 

Edit: The release version doesn't run at all if the Initialize function is allowed to happen. But I think this occurs in VS2010 and works fine in 2008 but the results are not consistent.

 

Anyone know how to remedy this?

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...