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

Kenneth C. Arnold kcarnold at xiph.org
Mon Dec 25 14:03:24 PST 2000



kcarnold    00/12/25 14:03:24

  Modified:    ogg123   ogg123.c
  Added:       ogg123   ogg123.h
  Log:
  A few minor cleanups, addition of a header file, and a few "oops!"es.

Revision  Changes    Path
1.15      +6 -28     vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ogg123.c	2000/12/25 21:24:25	1.14
+++ ogg123.c	2000/12/25 22:03:24	1.15
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.14 2000/12/25 21:24:25 kcarnold Exp $
+ last mod: $Id: ogg123.c,v 1.15 2000/12/25 22:03:24 kcarnold Exp $
 
  ********************************************************************/
 
@@ -41,29 +41,11 @@
 #include <vorbis/vorbisfile.h>
 #include <ao/ao.h>
 
+#include "ogg123.h"
+
 char convbuffer[4096];		/* take 8k out of the data segment, not the stack */
 int convsize = 4096;
 
-/* For facilitating output to multiple devices */
-typedef struct devices_s {
-    int driver_id;
-    ao_device_t *device;
-    ao_option_t *options;
-    struct devices_s *next_device;
-} devices_t;
-
-typedef struct ogg123_options_s {
-    char *read_file;		/* File to decode */
-    char shuffle;		/* Should we shuffle playing? */
-    signed short int verbose;	/* Verbose output if > 0, quiet if < 0 */
-    signed short int quiet;	/* Be quiet (no title) */
-    double seekpos;		/* Amount to seek by */
-    FILE *instream;		/* Stream to read from. */
-    devices_t *outdevices;	/* Streams to write to. */
-} ogg123_options_t;		/* Changed in 0.6 to be non-static */
-
-/* There used to be an "info" struct here that served little purpose. */
-
 struct {
     char *key;			/* includes the '=' for programming convenience */
     char *formatstr;		/* formatted output */
@@ -93,10 +75,6 @@
     {0, 0, 0, 0}
 };
 
-/* FIXME: XXX: YUCK: fixme. */
-void play_file(ogg123_options_t opt);	/* This really needs to go in a header file. */
-FILE *http_open(char *server, int port, char *path);
-
 devices_t *append_device(devices_t * devices_list, int driver_id,
                          ao_option_t * options)
 {
@@ -125,7 +103,7 @@
     }
 }
 
-void usage()
+void usage(void)
 {
     FILE *o;
     o = stderr;
@@ -195,7 +173,7 @@
        it will need a serious overhaul. */
     fp = fopen(filename, "r");
     if (fp) {
-      if (getline(line, 100, fp)) {
+      if (fgets(line, 100, fp)) {
         if (strncmp(line, "default_device=", 15) == 0) {
           device = &line[15];
           for (i = 0; i < strlen(device); i++)
@@ -501,7 +479,7 @@
                         break;
                     }
                 if (ogg_comment_keys[i].key == NULL)
-		    fprintf(stderr, "Unrecognized comment: '%s'\n");
+		    fprintf(stderr, "Unrecognized comment: '%s'\n", cc);
             }
 
             fprintf(stderr, "\nBitstream is %d channel, %ldHz\n",

1.1                  vorbis-tools/ogg123/ogg123.h

Index: ogg123.h
===================================================================
/* This file is part of ogg123, an Ogg Vorbis player. See ogg123.c
 * for copyright information. */
#ifndef __OGG123_H
#define __OGG123_H

/* For facilitating output to multiple devices */
typedef struct devices_s {
  int driver_id;
  ao_device_t *device;
  ao_option_t *options;
  struct devices_s *next_device;
} devices_t;

typedef struct ogg123_options_s {
  char *read_file;            /* File to decode */
  char shuffle;               /* Should we shuffle playing? */
  signed short int verbose;   /* Verbose output if > 0, quiet if < 0 */
  signed short int quiet;     /* Be quiet (no title) */
  double seekpos;             /* Amount to seek by */
  FILE *instream;             /* Stream to read from. */
  devices_t *outdevices;      /* Streams to write to. */
} ogg123_options_t;           /* Changed in 0.6 to be non-static */

devices_t *append_device(devices_t * devices_list, int driver_id,
                         ao_option_t * options);
void devices_write(void *ptr, size_t size, devices_t * d);
void usage(void);
int add_option(ao_option_t ** op_h, const char *optstring);
int get_default_device(void);
void play_file(ogg123_options_t opt);
int get_tcp_socket(void); /* Will be going soon. */
FILE *http_open(char *server, int port, char *path); /* ditto */

#endif /* !defined(__OGG123_H) */

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