[xiph-cvs] cvs commit: vorbis-tools/ogg123 buffer.h ogg123.c ogg123.h
Kenneth C. Arnold
kcarnold at xiph.org
Mon Aug 6 11:40:36 PDT 2001
kcarnold 01/08/06 11:40:35
Modified: ogg123 Tag: kcarnold_randomwork_20010806 buffer.h ogg123.c
ogg123.h
Log:
Random hackery that I don't like anymore but don't feel like
completely throwing away, so it'll live here for a while.
Revision Changes Path
No revision
No revision
1.2.2.3.2.1 +7 -0 vorbis-tools/ogg123/buffer.h
Index: buffer.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.h,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.3.2.1
diff -u -r1.2.2.3 -r1.2.2.3.2.1
--- buffer.h 2001/06/24 01:24:56 1.2.2.3
+++ buffer.h 2001/08/06 18:40:33 1.2.2.3.2.1
@@ -7,14 +7,21 @@
#include <sys/types.h>
+/* We use chunks to make things easier. Quite possibly this is wasting
+ at least two integers for every 4096 bytes, but it beats the
+ horrificly involved calculations involved with interleaved channels
+ and instantaneous bitrate information in a circular buffer. */
typedef struct chunk_s
{
+ ogg_int64_t sample; /* sample number of starting sample */
+ double bitrate; /* instantaneous bitrate at sample */
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. */
} chunk_t;
typedef struct buf_s
{
+ nonbuf_shared_t nonbuf_shared; /* other shared data */
char status; /* Status. See STAT_* below. */
int fds[2]; /* Pipe file descriptors. */
long size; /* buffer size, for reference */
1.39.2.5.2.1 +9 -3 vorbis-tools/ogg123/ogg123.c
Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.39.2.5
retrieving revision 1.39.2.5.2.1
diff -u -r1.39.2.5 -r1.39.2.5.2.1
--- ogg123.c 2001/06/24 01:24:56 1.39.2.5
+++ ogg123.c 2001/08/06 18:40:33 1.39.2.5.2.1
@@ -14,7 +14,7 @@
* *
********************************************************************
- last mod: $Id: ogg123.c,v 1.39.2.5 2001/06/24 01:24:56 kcarnold Exp $
+ last mod: $Id: ogg123.c,v 1.39.2.5.2.1 2001/08/06 18:40:33 kcarnold Exp $
********************************************************************/
@@ -37,6 +37,8 @@
char convbuffer[4096]; /* take 8k out of the data segment, not the stack */
int convsize = 4096;
buf_t * buffer = NULL;
+nonbuf_shared_t global_shared; /* used when no buffer */
+nonbuf_shared_t * shared_data = &global_shared;
static char skipfile_requested;
static void (*old_sig)(int);
@@ -347,7 +349,7 @@
"User-Agent: ogg123\r\n"
"Host: %s\r\n\r\n\r\n", path, server);
- fflush(opt.instream); /* Make sure these are all actually sent */
+ fflush(opt.instream); /* Make sure these are all actually sent */
/* Dump headers */
{
@@ -626,8 +628,12 @@
current = current->next_device;
}
- if (opt->buffer_size)
+ if (opt->buffer_size) {
*buffer = fork_writer (opt->buffer_size, opt->outdevices, opt->prebuffer);
+ shared_data = &(buffer->nonbuf_shared);
+ }
+
+ shared_data->
return 0;
}
1.7.2.5.2.1 +7 -1 vorbis-tools/ogg123/ogg123.h
Index: ogg123.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.h,v
retrieving revision 1.7.2.5
retrieving revision 1.7.2.5.2.1
diff -u -r1.7.2.5 -r1.7.2.5.2.1
--- ogg123.h 2001/06/24 01:24:56 1.7.2.5
+++ ogg123.h 2001/08/06 18:40:33 1.7.2.5.2.1
@@ -21,6 +21,13 @@
struct devices_s *next_device;
} devices_t;
+typedef nonbuf_shared_s
+{
+ char is_seekable;
+ ogg_int64_t totalsamples; /* if (!is_seekable) wholefile.samples=0 */
+ devices_t *outdevices; /* Streams to write to. */
+} nonbuf_shared_t;
+
typedef struct ogg123_options_s {
char *read_file; /* File to decode */
char shuffle; /* Should we shuffle playing? */
@@ -29,7 +36,6 @@
double seekpos; /* Amount to seek by */
FILE *instream; /* Stream to read from. */
char *default_device; /* default device for playback */
- devices_t *outdevices; /* Streams to write to. */
int buffer_size; /* Size of the buffer in chunks. */
int prebuffer; /* number of chunks to prebuffer */
int rate, channels; /* playback params for opening audio devices */
--- >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