Smpeg diffs

Sat Jan 22 17:35:52 PST 2000

A new “smpeg.h”, based on smpeg 0.3.3’s. Adds a version struct and macro
similar to SDL’s own:

—cut—
32a33,52

#define SMPEG_MAJOR_VERSION 0
#define SMPEG_MINOR_VERSION 3
#define SMPEG_PATCHLEVEL 3

typedef struct {
Uint8 major;
Uint8 minor;
Uint8 patch;
} SMPEG_version;

/* This macro can be used to fill a version structure with the compile-time

  • version of the SDL library.
    */
    #define SMPEG_VERSION(X)
    {
    (X)->major = SMPEG_MAJOR_VERSION;
    (X)->minor = SMPEG_MINOR_VERSION;
    (X)->patch = SMPEG_PATCHLEVEL;
    }

—cut—

And a new plaympeg.c based on smpeg 0.3.3’s.

  • Fixes “-v”/"–volume" strangeness when no argument is provided after the
    switch
  • Adds a “-V”/"–version" argument to display SDL & smpeg version numbers.
  • Also mentions “-h”/"–help" and “-V”/"–version" switches in the help/usage
    output)

—cut—
35c35,37
< " --volume N or -v N Set audio volume to N (0-100)\n", argv0);—

" --volume N or -v N Set audio volume to N (0-100)\n"
" --help or -h\n"
" --version or -V\n", argv0);
57a60,61
SDL_version sdlver;
SMPEG_version smpegver;
89a94,98
if (i >= argc)
{
fprintf(stderr, “Please specify volume when using --volume or -v\n”);
exit(1);
}
95a105,114
exit(0);
} else
if ((strcmp(argv[i], “–version”) == 0) ||
(strcmp(argv[i], “-V”) == 0)) {
SDL_VERSION(&sdlver);
SMPEG_VERSION(&smpegver);
printf(“SDL version: %d.%d.%d\n”
“SMPEG version: %d.%d.%d\n”,
sdlver.major, sdlver.minor, sdlver.patch,
smpegver.major, smpegver.minor, smpegver.patch);
—cut—

Enjoy!

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