i use source that came from this forum
#include <SDL/SDL.h>#include <SMPEG/smpeg.h>#include <iostream>// Surface for the main screenSDL_Surface *screen;// Surface for the movieSDL_Surface *movieSurface = 0;// Holds the movie informationSMPEG_Info movieInfo;// Load the movieSMPEG *movie = 0;void DrawIMG(SDL_Surface *img, int x, int y){ SDL_Rect dest; dest.x = x; dest.y = y; SDL_BlitSurface(img, NULL, screen, &dest);} int main(int argc, char *argv[]){ if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { std::cout<<"Unable to init SDL: %s\n"<< SDL_GetError(); // return -1; } screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_ANYFORMAT); if (screen == NULL) { std::cout<<"Unable to set 640x480 video: %s\n"<<SDL_GetError(); // return -1; } // Load the movie and store the information about it movie = SMPEG_new("C:/Dev-Cpp/Examples/SMPEG/test.mpg", &movieInfo, true); char* error = SMPEG_error(movie); if( error != NULL || movie == NULL ) { std::cout<<"Error loading MPEG: %s\n"<<error ; // return -1; } // Create a temporary surface to render the movie to SDL_Surface *tempSurface2 = SDL_CreateRGBSurface(SDL_SWSURFACE, movieInfo.width, movieInfo.height, 32, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); // Now make a surface optimized for the main screen movieSurface = SDL_DisplayFormat(tempSurface2); // Free the temporary surface SDL_FreeSurface(tempSurface2); // Set the surface to draw to SMPEG_setdisplay(movie, movieSurface, 0, 0); // Set the display region SMPEG_setdisplayregion(movie, 0, 0, movieInfo.width, movieInfo.height); // Loop forever SMPEG_loop(movie, -1); SDL_ShowCursor(SDL_DISABLE); int done = 0; SMPEG_play(movie); SMPEG_getinfo(movie, &movieInfo); while(done == 0) { SDL_Event event; while (SDL_PollEvent(&event)) { if (event.type == SDL_QUIT) { done = 1; } if (event.type == SDL_KEYDOWN) { if (event.key.keysym.sym == SDLK_ESCAPE) { done = 1; } } } DrawIMG(movieSurface, 0, 0); // Flip the main screen SDL_Flip(screen); } SDL_FreeSurface(movieSurface); SMPEG_stop(movie); SMPEG_delete(movie); movie = NULL; SDL_ShowCursor(SDL_ENABLE); return 0;}