[xiph-cvs] cvs commit: vorbis-tools/ogg123 ogg123.c

Ralph Giles giles at xiph.org
Sun Dec 17 12:29:33 PST 2000



giles       00/12/17 12:29:33

  Modified:    .        acinclude.m4
               ogg123   ogg123.c
  Log:
  update to use the new 0.6 libao api

Revision  Changes    Path
1.5       +0 -4      vorbis-tools/acinclude.m4

Index: acinclude.m4
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/acinclude.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- acinclude.m4	2000/11/08 04:26:33	1.4
+++ acinclude.m4	2000/12/17 20:29:32	1.5
@@ -1,7 +1,3 @@
-# Configure paths for libao
-# Jack Moffitt <jack at icecast.org> 10-21-2000
-# Shamelessly stolen from Owen Taylor and Manish Singh
-
 # ogg.m4
 # Configure paths for libogg
 # Jack Moffitt <jack at icecast.org> 10-21-2000

1.13      +25 -2     vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ogg123.c	2000/12/12 14:06:49	1.12
+++ ogg123.c	2000/12/17 20:29:32	1.13
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.12 2000/12/12 14:06:49 msmith Exp $
+ last mod: $Id: ogg123.c,v 1.13 2000/12/17 20:29:32 giles Exp $
 
  ********************************************************************/
 
@@ -169,6 +169,29 @@
   fprintf (o, "  -z, --shuffle  shuffle play\n");
 }
 
+int add_option(ao_option_t **op_h, const char *optstring)
+{
+	char *key, *value;
+	int  result;
+
+	key = strdup(optstring);
+	if (key == NULL) return 0;
+
+	value = strchr(key, ':');
+	if (value == NULL) {
+		free(key);
+		return 0;
+	}
+	
+	/* split by replacing the separator with a null */
+	*value++ = '\0';
+
+	result = ao_append_option(op_h, key, value);
+	free (key);
+	
+	return (result);
+}
+
 int get_default_device(void)
 {
         FILE *fp;
@@ -242,7 +265,7 @@
           param.seekpos = atof (optarg);
           break;
         case 'o':
-	  if (optarg && !ao_append_option(&temp_options, optarg))
+	  if (optarg && !add_option(&temp_options, optarg))
             {
               fprintf(stderr, "Incorrect option format: %s.\n", optarg);
               exit(1);

--- >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