Skip to main content
gamedev.net
🔒 Locked

smpeg odd behavior.

Started by CoderGuy 3 replies 1k views
Original Post
CoderGuy
CoderGuy
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.
CoderGuy
CoderGuy
Has anyone else encountered this before?
samuraicrow
samuraicrow
SDL.dll is supposed to be in your C:\windows\system32\ directory. That could be causing your confusion.
CoderGuy
CoderGuy
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.
CoderGuy
CoderGuy
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;}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.