[xiph-cvs] cvs commit: vorbis-tools/ogg123 ao_interface.c ogg123.c
Michael Smith
msmith at xiph.org
Tue Feb 20 00:10:23 PST 2001
msmith 01/02/20 00:10:23
Modified: ogg123 ao_interface.c ogg123.c
Log:
Bugfixes from Aaron Plattner for multiple device opening.
Revision Changes Path
1.3 +1 -1 vorbis-tools/ogg123/ao_interface.c
Index: ao_interface.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ao_interface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ao_interface.c 2001/02/19 22:22:28 1.2
+++ ao_interface.c 2001/02/20 08:10:22 1.3
@@ -21,7 +21,7 @@
devices_list->options = options;
devices_list->next_device = NULL;
- return head;
+ return devices_list;
}
void devices_write(void *ptr, size_t size, devices_t * d)
1.25 +13 -11 vorbis-tools/ogg123/ogg123.c
Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ogg123.c 2001/02/19 05:18:09 1.24
+++ ogg123.c 2001/02/20 08:10:22 1.25
@@ -14,7 +14,7 @@
* *
********************************************************************
- last mod: $Id: ogg123.c,v 1.24 2001/02/19 05:18:09 jsquyres Exp $
+ last mod: $Id: ogg123.c,v 1.25 2001/02/20 08:10:22 msmith Exp $
********************************************************************/
@@ -99,6 +99,7 @@
int ret;
int option_index = 1;
ao_option_t *temp_options = NULL;
+ ao_option_t ** current_options = &temp_options;
int temp_driver_id = -1;
buf_t *buffer = NULL;
devices_t *current;
@@ -114,8 +115,6 @@
ao_initialize();
- temp_driver_id = get_default_device();
-
while (-1 != (ret = getopt_long(argc, argv, "b:d:hk:o:qvV:z",
long_options, &option_index))) {
switch (ret) {
@@ -132,12 +131,16 @@
fprintf(stderr, "No such device %s.\n", optarg);
exit(1);
}
+ current = append_device(opt.outdevices, temp_driver_id, NULL);
+ if(opt.outdevices == NULL)
+ opt.outdevices = current;
+ current_options = ¤t->options;
break;
case 'k':
opt.seekpos = atof(optarg);
break;
case 'o':
- if (optarg && !add_option(&temp_options, optarg)) {
+ if (optarg && !add_option(current_options, optarg)) {
fprintf(stderr, "Incorrect option format: %s.\n", optarg);
exit(1);
}
@@ -167,17 +170,18 @@
/* Add last device to device list or use the default device */
if (temp_driver_id < 0) {
- temp_driver_id = ao_get_driver_id(NULL);
+ temp_driver_id = get_default_device();
+ if(temp_driver_id < 0) {
+ temp_driver_id = ao_get_driver_id(NULL);
+ }
if (temp_driver_id < 0) {
fprintf(stderr,
"Could not load default driver and no ~/.ogg123_rc found. Exiting.\n");
exit(1);
}
+ opt.outdevices = append_device(opt.outdevices, temp_driver_id, temp_options);
}
- opt.outdevices =
- append_device(opt.outdevices, temp_driver_id, temp_options);
-
if (optind == argc) {
usage();
exit(1);
@@ -494,6 +498,7 @@
fprintf(stderr, "Device: %s\n", info->name);
fprintf(stderr, "Author: %s\n", info->author);
fprintf(stderr, "Comments: %s\n", info->comment);
+ fprintf(stderr, "\n"); // Gotta keep 'em separated ...
}
current->device = ao_open(current->driver_id, 16, rate, channels,
@@ -502,9 +507,6 @@
fprintf(stderr, "Error opening device.\n");
return -1;
}
- if (opt->quiet < 1)
- fprintf(stderr, "\n"); /* Gotta keep 'em separated ... */
-
current = current->next_device;
}
--- >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