Jump to content
  • Advertisement
Sign in to follow this  
CoderGuy

smpeg odd behavior.

This topic is 4827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone. I'm using smpeg with SDL to play videos in my programs and I noticed that it links up to -LSDL.dll, and if I don't have that DLL in the directory of the example program then I can see the video when I execute it in Dev CPP. If I put SDL.dll into the directory of the program so that I can run it, I cannot see the video, just hear the audio. Does anyone know of a solution to this problem? I downloaded smpeg from a devpack with Dev-CPP. Oh, I'm using Windows.

Share this post


Link to post
Share on other sites
Advertisement
What's going on is that if I run the program in Dev-CPP without SDL.dll in the directory of my executable, it works fine because the example linked up to SDL.dll by -lSDL.dll.

WHen the dll isn't in the same directory as my executable, I can run the program in Dev-CPP, but if I put SDL.dll in the directory, I don't see any video.

I used to have SDL.dll in system32, but the reason that I don't, is that I want to make sure I know what dll's I need to have if I e-mail my programs to my friends so that they can run them.

Share this post


Link to post
Share on other sites
Here's the code.


#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>

#include <SMPEG/smpeg.h>

SDL_Surface *screen = NULL;

void shutdown(void){
SDL_Quit();
}

int main(int argc, char *argv[]){

SDL_Init(SDL_INIT_VIDEO);
atexit(shutdown);

screen = SDL_SetVideoMode(640,480,32,SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
SDL_WM_SetCaption("Dev-C++ SMPEG-Lib Test", NULL);

SDL_ShowCursor(SDL_DISABLE);

SMPEG_Info mpg_info;
SMPEGstatus mpg_status;
SMPEG* mpg = SMPEG_new("test.mpg",&mpg_info,1);

SMPEG_setdisplay(mpg,screen,NULL,NULL);
SMPEG_play(mpg);

mpg_status = SMPEG_status(mpg);

while(mpg_status == SMPEG_PLAYING){
mpg_status = SMPEG_status(mpg);
SDL_Delay(1000);
}

SMPEG_stop(mpg);
SMPEG_delete(mpg);
mpg = NULL;

SDL_ShowCursor(SDL_ENABLE);

return 0;
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!