SMPEG problems

I’m having some trouble incorporating SMPEG into my game. At different
times I need to be able to play an .mpg file. That is working fine.
The movie plays, and I can even return to the game when it completes.

My problem is why I try to skip the movie after it starts. If you see
the movie once, there is really no need to see it again, so I’m trying
to get it so the user can press a key to skip the movie. My problem is
that the following function calls all hang until the movie completes.

SMPEG_stop(mpeg);
SMPEG_delete(mpeg);
SMPEG_enablevideo(mpeg, 0);

I’m not calling all three of the above, I’ve just tried to call all
three, but they always hang there until the movie completes. If I place
an printf statement after any of the above calls, it doesn’t get printed
until the movie completes.

Any ideas on why this might be happening? Any ideas about where I can
look to track this issue down?–
Jason Stechschulte
@Jason_Stechschulte

Truth is hard to find and harder to obscure.

Hey,

The following code is what I used in my application. Maybe it is of help
to you, since users of my app could abort the video playback :slight_smile:
Marc

// play mpeg
int x = (o.width - info.width) / 2;
int y = (o.height - info.height) / 2;
SMPEG_enableaudio(mpeg, 1);
SMPEG_enablevideo(mpeg, 1);
SMPEG_setvolume(mpeg, 75);
SMPEG_setdisplay(mpeg, screen, NULL, NULL);
SMPEG_scaleXY(mpeg, info.width, info.height);
SMPEG_move(mpeg, x, y);
SMPEG_play(mpeg);
bool abortmovie = false;
while (!abortmovie && (SMPEG_status(mpeg) == SMPEG_PLAYING)) {
SDL_Event event;
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE) abortmovie = true;
}
}
}
SDL_Delay(100);
}
SMPEG_stop(mpeg);
SMPEG_delete(mpeg);

Jason Stechschulte wrote:> I’m having some trouble incorporating SMPEG into my game. At different

times I need to be able to play an .mpg file. That is working fine.
The movie plays, and I can even return to the game when it completes.

My problem is why I try to skip the movie after it starts. If you see
the movie once, there is really no need to see it again, so I’m trying
to get it so the user can press a key to skip the movie. My problem is
that the following function calls all hang until the movie completes.

SMPEG_stop(mpeg);
SMPEG_delete(mpeg);
SMPEG_enablevideo(mpeg, 0);

I’m not calling all three of the above, I’ve just tried to call all
three, but they always hang there until the movie completes. If I place
an printf statement after any of the above calls, it doesn’t get printed
until the movie completes.

Any ideas on why this might be happening? Any ideas about where I can
look to track this issue down?

I am encountering a problem while using the SMPEG lib with SDL_mixer. Most MP3
files will play fine but some (I can’t be more precise) cause my app to hang?
Has anyone else encountered this?

I did read somewhere that SMPEG was a little buggy?

I have version 1.2.7 of SDL.
I have version 1.2.5 of SDL_Mixer.
I have the latest CVS version on SMPEG.

Kind Regards,

Lee