Hi. I’m trying to get SMPEG to play movies in my OpenGL based program (need to switch from movie to 3d, back and forth at will). I based my code on one of the examples supplied with SMPEG (glmovie.c). It works fairly well, except it crashes with segfault/access violation if I try to playback a movie that has bigger resolution than the application window’s resolution.
For example, if my application window is 640x480, I can play a movie that’s 480x320 in resolution, but not 800x600. I can make the application window bigger to get around this problem, but the final application must be user resizable.
It’s crashing somewhere inside SDL code (I haven’t tried debugging SDL code) and the stack trace doesn’t show any of my application functions or SMPEG functions.
Then there’s this:
http://dranger.com/ffmpeg/functions.html
It claims, under “SDL_CreateYUVOverlay()” section, that the surface passed into this function must be obtained from SDL_SetVideoMode(), else it will segfault (SMPEG makes SDL_CreateYUVOverlay() calls when rendering). In my code, and in glmovie sample code, the surface isn’t obtained through SetVideoMode, but rather using SDL_AllocSurface(). Am I to understand that this isn’t allowed? Why is the glmovie sample code doing it? Also, why does it seemingly work when the application window is larger than the movie resolution?
I’m using SDL 1.2 with Windows and an NVidia video card with latest drivers, if that helps.
Thanks.