[xiph-cvs] cvs commit: vorbis-tools/ogg123 ogg123.1 ogg123.c
Chris Cheney
calc at xiph.org
Sun Jun 17 16:52:52 PDT 2001
calc 01/06/17 16:52:52
Modified: ogg123 ogg123.1 ogg123.c
Log:
Fixed missing options in manpage, corrected filename of ogg123rc in ogg123.c
Revision Changes Path
1.4 +4 -0 vorbis-tools/ogg123/ogg123.1
Index: ogg123.1
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.1,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ogg123.1 2001/02/24 01:39:19 1.3
+++ ogg123.1 2001/06/17 23:52:51 1.4
@@ -35,12 +35,16 @@
can be streamed via HTTP.
.SH OPTIONS
+.IP "-b n, --buffer n"
+Use a buffer of 'n' chunks (4096 bytes)
.IP "-d device, --device device"
Specify output device. See
.B DEVICES
section for a list of devices. Any number of devices may be specified.
.IP "-h, --help"
Show command help.
+.IP "-k n, --skip n"
+Skip the first 'n' seconds
.IP "-o option:value, --device-option option:value"
Assigns the option
.I option
1.33 +15 -23 vorbis-tools/ogg123/ogg123.c
Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ogg123.c 2001/04/08 02:33:30 1.32
+++ ogg123.c 2001/06/17 23:52:51 1.33
@@ -14,7 +14,7 @@
* *
********************************************************************
- last mod: $Id: ogg123.c,v 1.32 2001/04/08 02:33:30 jack Exp $
+ last mod: $Id: ogg123.c,v 1.33 2001/06/17 23:52:51 calc Exp $
********************************************************************/
@@ -174,7 +174,7 @@
}
if (temp_driver_id < 0) {
fprintf(stderr,
- "Could not load default driver and no ~/.ogg123_rc found. Exiting.\n");
+ "Could not load default driver and no ~/.ogg123rc found. Exiting.\n");
exit(1);
}
opt.outdevices = append_device(opt.outdevices, temp_driver_id, temp_options);
@@ -186,30 +186,22 @@
}
if (opt.shuffle) {
- /* Messy code that I didn't write -ken */
int i;
- int nb = argc - optind;
- int *p = alloca(sizeof(int) * nb);
- for (i = 0; i < nb; i++)
- p[i] = i;
-
+
srand(time(NULL));
- for (i = 1; i < nb; i++) {
- int j = i * ((float) rand() / RAND_MAX);
- int temp = p[j];
- p[j] = p[i];
- p[i] = temp;
- }
- for (i = 0; i < nb; i++) {
- opt.read_file = argv[p[i] + optind];
- play_file(opt);
- }
- } else {
- while (optind < argc) {
- opt.read_file = argv[optind];
- play_file(opt);
- optind++;
+
+ for (i = optind; i < argc; i++) {
+ int j = optind + rand() % (argc - i);
+ char *temp = argv[i];
+ argv[i] = argv[j];
+ argv[j] = temp;
}
+ }
+
+ while (optind < argc) {
+ opt.read_file = argv[optind];
+ play_file(opt);
+ optind++;
}
while (opt.outdevices != NULL) {
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list