Plaympeg bug

When using “plaympeg” to watch MPEG movies, if I use the “–loop” or "-l"
switch, the program still usually closes itself. (I thought perhaps it
was looping only a few times, not forever, for a reason.)

I think I just figured out why… There’s a while loop:

while (!SDL_QuitRequested() && (SMPEG_status(mpeg) == SMPEG_PLAYING))

It appears that between playing an MPEG the X’th time and starting to play it
the X+1’th time, that “SMPEG_status()” stops returning SMPEG_PLAYING.
(I’m not positive this is true, but it seems like it.)

Since the bulk of the above look is a 0.5 second delay, SOMETIMES the
program would notice that the movie stopped playing (because it was
in between the X’th and X+1’th showings), but most of the time, not notice.

I suggest changing that line to:

while (!SDL_QuitRequested() &&
(loop_play || SMPEG_status(mpeg) == SMPEG_PLAYING))

This way, when you’re using the “–loop” option, it will keep running,
regardless of whether or not the MPEG is playing at that very moment.
(However, perhaps it might be nicer in the API if SMPEG_status() didn’t
return non-SMPEG_PLAYING if SMPEG_loop(); has been called with ‘repeat’ set.)

… And if you don’t use the “–loop” option, it will stop that while-loop
when the movie has finished playing the one time.

-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

This is fixed internally. Thanks. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec