diff options
author | Chris Robinson <[email protected]> | 2013-02-03 04:55:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-02-03 04:55:44 -0800 |
commit | 89fae876a46e6f57f2dde63a074d2c2715991fcc (patch) | |
tree | 52e412ebba59f461fb446be5a8482c6693cf902f /examples | |
parent | ac4930e2338d5a7eee7127bc9f4552cbd5378c5c (diff) |
Only print the filename in alstream, without the path
Diffstat (limited to 'examples')
-rw-r--r-- | examples/alstream.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/alstream.c b/examples/alstream.c index 121cec00..8d36366d 100644 --- a/examples/alstream.c +++ b/examples/alstream.c @@ -315,10 +315,19 @@ int main(int argc, char **argv) /* Play each file listed on the command line */ for(i = 1;i < argc;i++) { + const char *namepart; + if(!OpenPlayerFile(player, argv[i])) continue; - printf("Playing %s (%s, %s, %dhz)\n", argv[i], + /* Get the name portion, without the path, for display. */ + namepart = strrchr(argv[i], '/'); + if(namepart || (namepart=strrchr(argv[i], '\\'))) + namepart++; + else + namepart = argv[i]; + + printf("Playing: %s (%s, %s, %dhz)\n", namepart, TypeName(player->type), ChannelsName(player->channels), player->rate); fflush(stdout); |