aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alstream.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-09-08 12:05:08 -0700
committerChris Robinson <[email protected]>2016-09-08 12:14:28 -0700
commit0f24f49a44a12d139692d0846b2722de2213f1a8 (patch)
treeed7a9c9954e56082a27bebfa07fc4c6fbce18c43 /examples/alstream.c
parentb21e481827b660e7439fcebb505cdb0349517a54 (diff)
Allow specifying the device to open for the examples
Diffstat (limited to 'examples/alstream.c')
-rw-r--r--examples/alstream.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/alstream.c b/examples/alstream.c
index 63478d6a..65a04475 100644
--- a/examples/alstream.c
+++ b/examples/alstream.c
@@ -270,14 +270,15 @@ int main(int argc, char **argv)
StreamPlayer *player;
int i;
- /* Print out usage if no file was specified */
+ /* Print out usage if no arguments were specified */
if(argc < 2)
{
- fprintf(stderr, "Usage: %s <filenames...>\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-device <name>] <filenames...>\n", argv[0]);
return 1;
}
- if(InitAL() != 0)
+ argv++; argc--;
+ if(InitAL(&argv, &argc) != 0)
return 1;
if(alIsExtensionPresent("AL_SOFT_buffer_samples"))
@@ -292,7 +293,7 @@ int main(int argc, char **argv)
player = NewPlayer();
/* Play each file listed on the command line */
- for(i = 1;i < argc;i++)
+ for(i = 0;i < argc;i++)
{
const char *namepart;