Hello SDL,
I’m aware that this might be the wrong place to ask because:
a) This might be an internal sdl developers list. Depends how you
interppret “issues” in “This is a high volume list for discussion of
SDL development and issues related to SDL”.
b) SMPEG isnt maintained by you guys, but as loki died… and google
isn’t helping much.
So I aplogise in advance, is there a better place to ask?
We are writing a windows media center style interface for a University
Assignment with SDL/SMPEG and eventually C++, but for now plain C
(prototype).
The code we have works, but the framerate gets slower and slower as if
we have a painters algorithm bug. Here is the code:====================
#include <stdio.h>
#include <smpeg.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
void vid_callback(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);
int main(int argc, char **argv) {
SMPEG_Info vidinfo;
bzero((void *) &vidinfo, sizeof(SMPEG_Info));
SMPEG *vid = SMPEG_new("/home/edd/a.mpg", &vidinfo, 0);
if(!vidinfo.has_video) {
printf("Error occurred");
}
if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_DOUBLEBUF) < 0) {
printf("%s\n", SDL_GetError());
exit(1);
}
SDL_Surface *screen = SDL_SetVideoMode(vidinfo.width,
vidinfo.height, 0, SDL_HWSURFACE);
SMPEG_enablevideo(vid, 1);
SMPEG_setdisplay(vid, screen, NULL, NULL);
//(SMPEG_DisplayCallback) vid_callback);
SMPEG_play(vid);
do {
SDL_Delay(250);
} while (!SDL_QuitRequested() && SMPEG_status(vid) == SMPEG_PLAYING);
}
// Currently unused
void vid_callback(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w,
Sint32 h) {
}
================
Are we doing something terribly wrong?
Our platform is OpenBSD(Fast enough) and also linux (really fast
machine!). The code behaves the same on both.
Also does anyone know if there is any more documentation for SMPEG
other than the man page and source code?
Thanks
–
Best Regards
Edd + Geerd