aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-02-03 04:55:44 -0800
committerChris Robinson <[email protected]>2013-02-03 04:55:44 -0800
commit89fae876a46e6f57f2dde63a074d2c2715991fcc (patch)
tree52e412ebba59f461fb446be5a8482c6693cf902f /examples
parentac4930e2338d5a7eee7127bc9f4552cbd5378c5c (diff)
Only print the filename in alstream, without the path
Diffstat (limited to 'examples')
-rw-r--r--examples/alstream.c11
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);