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

Stan Seibert volsung at xiph.org
Sat Aug 4 16:54:38 PDT 2001



volsung     01/08/04 16:54:38

  Modified:    ogg123   buffer.h ogg123.1 ogg123.c
  Log:
  - Made constant for buffer chunk size
  - Buffer size now input in kilobytes
  - Updated manpage to reflect these changes

Revision  Changes    Path
1.3       +4 -1      vorbis-tools/ogg123/buffer.h

Index: buffer.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- buffer.h	2001/06/19 19:42:35	1.2
+++ buffer.h	2001/08/04 23:54:37	1.3
@@ -5,10 +5,13 @@
 
 #include "ogg123.h"
 
+/* 4096 is the chunk size we request from libvorbis. */
+#define BUFFER_CHUNK_SIZE 4096
+
 typedef struct chunk_s
 {
   long len; /* Length of the chunk (for if we only got partial data) */
-  char data[4096]; /* Data. 4096 is the chunk size we request from libvorbis. */
+  char data[BUFFER_CHUNK_SIZE]; 
 } chunk_t;
 
 typedef struct buf_s

1.9       +6 -2      vorbis-tools/ogg123/ogg123.1

Index: ogg123.1
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.1,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ogg123.1	2001/08/04 02:57:01	1.8
+++ ogg123.1	2001/08/04 23:54:37	1.9
@@ -11,8 +11,12 @@
 [
 .B -vqzVh
 ] [
-.B -k seconds 
+.B -k
+.I seconds 
 ] [
+.B -b
+.I buffer_size 
+] [
 .B -d
 .I driver 
 [
@@ -40,7 +44,7 @@
 
 .SH OPTIONS
 .IP "-b n, --buffer n"
-Use a buffer of 'n' chunks (4096 bytes)
+Use a buffer of approximately 'n' kilobytes.
 .IP "-d device, --device device"
 Specify output device.  See
 .B DEVICES

1.42      +6 -5      vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- ogg123.c	2001/08/04 02:57:01	1.41
+++ ogg123.c	2001/08/04 23:54:37	1.42
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.41 2001/08/04 02:57:01 volsung Exp $
+ last mod: $Id: ogg123.c,v 1.42 2001/08/04 23:54:37 volsung Exp $
 
  ********************************************************************/
 
@@ -34,8 +34,9 @@
 
 #include "ogg123.h"
 
-char convbuffer[4096];		/* take 8k out of the data segment, not the stack */
-int convsize = 4096;
+/* take buffer out of the data segment, not the stack */
+char convbuffer[BUFFER_CHUNK_SIZE];
+int convsize = BUFFER_CHUNK_SIZE;
 buf_t * buffer = NULL;
 
 static char skipfile_requested;
@@ -102,7 +103,7 @@
             "  -o, --device-option=k:v passes special option k with value\n"
             "      v to previously specified device (with -d).  See\n"
             "      man page for more info.\n"
-	    "  -b n, --buffer n  use a buffer of 'n' chunks (4096 bytes)\n"
+	    "  -b n, --buffer n  use a buffer of approximately 'n' kilobytes\n"
             "  -v, --verbose  display progress and other useful stuff\n"
             "  -q, --quiet    don't display anything (no title)\n"
             "  -z, --shuffle  shuffle play\n"
@@ -143,7 +144,7 @@
                     "Internal error: long option given when none expected.\n");
             exit(1);
         case 'b':
-	  opt.buffer_size = atoi (optarg);
+	  opt.buffer_size = atoi(optarg) / (BUFFER_CHUNK_SIZE / 1024);
           break;
         case 'd':
             temp_driver_id = ao_driver_id(optarg);

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