[xiph-cvs] cvs commit: libshout/src vorbis.c

Brendan brendan at xiph.org
Wed Apr 2 15:44:26 PST 2003



brendan     03/04/02 18:44:26

  Modified:    src      vorbis.c
  Log:
  Locally consistent indentation

Revision  Changes    Path
1.7       +38 -38    libshout/src/vorbis.c

Index: vorbis.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/vorbis.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vorbis.c	2 Apr 2003 12:09:04 -0000	1.6
+++ vorbis.c	2 Apr 2003 23:44:26 -0000	1.7
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 8; -*- */
 /* vorbis.c: Ogg Vorbis data handlers for libshout */
 
 #ifdef HAVE_CONFIG_H
@@ -21,12 +22,12 @@
         unsigned int samplerate;
 
         ogg_sync_state oy;
-    ogg_stream_state os;
+	ogg_stream_state os;
 
-    int headers;
-    vorbis_info vi;
-    vorbis_comment vc;
-    int prevW;
+	int headers;
+	vorbis_info vi;
+	vorbis_comment vc;
+	int prevW;
 
         long serialno;
 } vorbis_data_t;
@@ -53,17 +54,16 @@
 
 static int blocksize(vorbis_data_t *vd, ogg_packet *p)
 {
-    int this = vorbis_packet_blocksize(&vd->vi, p);
-    int ret = (this + vd->prevW)/4;
+	int this = vorbis_packet_blocksize(&vd->vi, p);
+	int ret = (this + vd->prevW)/4;
 
-    if(!vd->prevW)
-    {
-        vd->prevW = this;
-        return 0;
-    }
+	if(!vd->prevW) {
+		vd->prevW = this;
+		return 0;
+	}
 
-    vd->prevW = this;
-    return ret;
+	vd->prevW = this;
+	return ret;
 }
 
 static int send_vorbis(shout_t *self, const unsigned char *data, size_t len)
@@ -73,7 +73,7 @@
         char *buffer;
         ogg_page og;
         ogg_packet op;
-    int samples;
+	int samples;
 
         buffer = ogg_sync_buffer(&vorbis_data->oy, len);
         memcpy(buffer, data, len);
@@ -82,8 +82,8 @@
         while (ogg_sync_pageout(&vorbis_data->oy, &og) == 1) {
                 if (vorbis_data->serialno != ogg_page_serialno(&og)) {
 
-            /* Clear the old one - this is safe even if there was no previous
-             * stream */
+			/* Clear the old one - this is safe even if there was no previous
+			 * stream */
                         vorbis_comment_clear(&vorbis_data->vc);
                         vorbis_info_clear(&vorbis_data->vi);
                         ogg_stream_clear(&vorbis_data->os);
@@ -95,32 +95,32 @@
                         vorbis_info_init(&vorbis_data->vi);
                         vorbis_comment_init(&vorbis_data->vc);
 
-            vorbis_data->headers = 1;
+			vorbis_data->headers = 1;
                 }
 
-        samples = 0;
+		samples = 0;
 
-        ogg_stream_pagein(&vorbis_data->os, &og);
-        while(ogg_stream_packetout(&vorbis_data->os, &op) == 1) {
-            int size;
-
-            if(vorbis_data->headers > 0 && vorbis_data->headers <= 3) {
-			    vorbis_synthesis_headerin(&vorbis_data->vi, &vorbis_data->vc, 
-                        &op);
-                if(vorbis_data->headers == 1)
-        			vorbis_data->samplerate = vorbis_data->vi.rate;
-
-                vorbis_data->headers++;
-                continue;
-            }
-
-            vorbis_data->headers = 0;
-            size = blocksize(vorbis_data, &op);
-            samples += size;
-        }
+		ogg_stream_pagein(&vorbis_data->os, &og);
+		while(ogg_stream_packetout(&vorbis_data->os, &op) == 1) {
+			int size;
+
+			if(vorbis_data->headers > 0 && vorbis_data->headers <= 3) {
+				vorbis_synthesis_headerin(&vorbis_data->vi, &vorbis_data->vc, 
+							  &op);
+				if(vorbis_data->headers == 1)
+					vorbis_data->samplerate = vorbis_data->vi.rate;
+
+				vorbis_data->headers++;
+				continue;
+			}
+
+			vorbis_data->headers = 0;
+			size = blocksize(vorbis_data, &op);
+			samples += size;
+		}
 
                 self->senttime += ((double)samples * 1000000) / 
-                ((double)vorbis_data->samplerate);
+			((double)vorbis_data->samplerate);
 
                 ret = sock_write_bytes(self->socket, og.header, og.header_len);
                 if (ret != og.header_len)

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