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

Kenneth C. Arnold kcarnold at xiph.org
Wed Aug 22 18:52:56 PDT 2001



kcarnold    01/08/22 18:52:55

  Modified:    ogg123   Tag: kcarnold_work ogg123.c options.c
  Log:
  Fudge with status item priorities a bit, as suggested by volsung

Revision  Changes    Path
No                   revision

No                   revision

1.39.2.25 +19 -14    vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.39.2.24
retrieving revision 1.39.2.25
diff -u -r1.39.2.24 -r1.39.2.25
--- ogg123.c	2001/08/23 01:26:42	1.39.2.24
+++ ogg123.c	2001/08/23 01:52:54	1.39.2.25
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.39.2.24 2001/08/23 01:26:42 kcarnold Exp $
+ last mod: $Id: ogg123.c,v 1.39.2.25 2001/08/23 01:52:54 kcarnold Exp $
 
  ********************************************************************/
 
@@ -148,11 +148,11 @@
   cur = &stats[6]; /* input buffer fill % */
   cur->prio = 2; cur->enabled = 0; cur->formatstr = " Input Buffer %5.1f%%"; cur->type = stat_doublearg;
   cur = &stats[7]; /* input buffer status */
-  cur->prio = 3; cur->enabled = 0; cur->formatstr = "(%s)"; cur->type = stat_stringarg; cur->arg.stringarg = NULL;
+  cur->prio = 2; cur->enabled = 0; cur->formatstr = "(%s)"; cur->type = stat_stringarg; cur->arg.stringarg = NULL;
   cur = &stats[8]; /* output buffer fill % */
   cur->prio = 2; cur->enabled = 0; cur->formatstr = " Output Buffer %5.1f%%"; cur->type = stat_doublearg;
   cur = &stats[9]; /* output buffer status */
-  cur->prio = 3; cur->enabled = 0; cur->formatstr = "%s"; cur->type = stat_stringarg; cur->arg.stringarg = NULL;
+  cur->prio = 1; cur->enabled = 0; cur->formatstr = "%s"; cur->type = stat_stringarg; cur->arg.stringarg = NULL;
 }
 
 void SetTime (Stat_t stats[], ogg_int64_t sample)
@@ -258,18 +258,23 @@
   UpdateStats (Options.statOpts.stats);
   cursample += Options.playOpts.nth * size * nmemb / Options.outputOpts.channels / 2 / Options.playOpts.ntimes; /* locked to 16-bit */
 
-  /* don't actually write until we have a full chunk, or of course EOS */
-  while (size) {
-    int toChunkNow = BUFFER_CHUNK_SIZE - curBuffered <= size ? BUFFER_CHUNK_SIZE - curBuffered : size;
-    memmove (RechunkBuffer + curBuffered, data, toChunkNow);
-    size -= toChunkNow;
-    data += toChunkNow;
-    curBuffered += toChunkNow;
-    if (curBuffered == BUFFER_CHUNK_SIZE) {
-      devices_write (RechunkBuffer, curBuffered, 1, Options.outputOpts.devices);
-      curBuffered = 0;
+  /* optimized fast path */
+  if (curBuffered == BUFFER_CHUNK_SIZE && curBuffered == 0)
+    devices_write (ptr, size, 1, Options.outputOpts.devices);
+  else
+    /* don't actually write until we have a full chunk, or of course EOS */
+    while (size) {
+      int toChunkNow = BUFFER_CHUNK_SIZE - curBuffered <= size ? BUFFER_CHUNK_SIZE - curBuffered : size;
+      memmove (RechunkBuffer + curBuffered, data, toChunkNow);
+      size -= toChunkNow;
+      data += toChunkNow;
+      curBuffered += toChunkNow;
+      if (curBuffered == BUFFER_CHUNK_SIZE) {
+	devices_write (RechunkBuffer, curBuffered, 1, Options.outputOpts.devices);
+	curBuffered = 0;
+      }
     }
-  }
+
   if (iseos) {
     cursample = 0;
     devices_write (RechunkBuffer, curBuffered, 1, Options.outputOpts.devices);

1.1.2.4   +2 -1      vorbis-tools/ogg123/Attic/options.c

Index: options.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/options.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- options.c	2001/08/22 16:42:31	1.1.2.3
+++ options.c	2001/08/23 01:52:55	1.1.2.4
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: options.c,v 1.1.2.3 2001/08/22 16:42:31 kcarnold Exp $
+ last mod: $Id: options.c,v 1.1.2.4 2001/08/23 01:52:55 kcarnold Exp $
 
  ********************************************************************/
 
@@ -142,6 +142,7 @@
 
       case opt_type_string:
         opt->found++;
+	if (*(char **)opt->ptr) free(*(char **)opt->ptr);
         *(char **) opt->ptr = strdup (value);
         break;
 

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