Commit bb14728b authored by conrad's avatar conrad

formatting: replace tabs with spaces


git-svn-id: http://svn.annodex.net/liboggz/trunk@2562 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent dfcd6cd8
...@@ -100,7 +100,7 @@ oggz_read_close (OGGZ * oggz) ...@@ -100,7 +100,7 @@ oggz_read_close (OGGZ * oggz)
int int
oggz_set_read_callback (OGGZ * oggz, long serialno, oggz_set_read_callback (OGGZ * oggz, long serialno,
OggzReadPacket read_packet, void * user_data) OggzReadPacket read_packet, void * user_data)
{ {
OggzReader * reader; OggzReader * reader;
oggz_stream_t * stream; oggz_stream_t * stream;
...@@ -134,7 +134,7 @@ oggz_set_read_callback (OGGZ * oggz, long serialno, ...@@ -134,7 +134,7 @@ oggz_set_read_callback (OGGZ * oggz, long serialno,
int int
oggz_set_read_page (OGGZ * oggz, long serialno, OggzReadPage read_page, oggz_set_read_page (OGGZ * oggz, long serialno, OggzReadPage read_page,
void * user_data) void * user_data)
{ {
OggzReader * reader; OggzReader * reader;
oggz_stream_t * stream; oggz_stream_t * stream;
...@@ -196,15 +196,15 @@ oggz_get_next_page_7 (OGGZ * oggz, ogg_page * og) ...@@ -196,15 +196,15 @@ oggz_get_next_page_7 (OGGZ * oggz, ogg_page * og)
buffer = ogg_sync_buffer (&reader->ogg_sync, CHUNKSIZE); buffer = ogg_sync_buffer (&reader->ogg_sync, CHUNKSIZE);
if ((bytes = oggz_io_read (oggz, buffer, CHUNKSIZE)) == 0) { if ((bytes = oggz_io_read (oggz, buffer, CHUNKSIZE)) == 0) {
#if 0 #if 0
if (ferror (oggz->file)) { if (ferror (oggz->file)) {
oggz_set_error (oggz, OGGZ_ERR_SYSTEM); oggz_set_error (oggz, OGGZ_ERR_SYSTEM);
return -1; return -1;
} }
#endif #endif
} }
if (bytes == 0) { if (bytes == 0) {
return -2; return -2;
} }
ogg_sync_wrote(&reader->ogg_sync, bytes); ogg_sync_wrote(&reader->ogg_sync, bytes);
...@@ -272,11 +272,11 @@ oggz_read_sync (OGGZ * oggz) ...@@ -272,11 +272,11 @@ oggz_read_sync (OGGZ * oggz)
stream = oggz_get_stream (oggz, serialno); stream = oggz_get_stream (oggz, serialno);
if (stream == NULL) { if (stream == NULL) {
/* new stream ... check bos etc. */ /* new stream ... check bos etc. */
if ((stream = oggz_add_stream (oggz, serialno)) == NULL) { if ((stream = oggz_add_stream (oggz, serialno)) == NULL) {
/* error -- could not add stream */ /* error -- could not add stream */
return -7; return -7;
} }
} }
os = &stream->ogg_stream; os = &stream->ogg_stream;
...@@ -284,7 +284,7 @@ oggz_read_sync (OGGZ * oggz) ...@@ -284,7 +284,7 @@ oggz_read_sync (OGGZ * oggz)
if(result == -1) { if(result == -1) {
#ifdef DEBUG #ifdef DEBUG
printf ("oggz_read_sync: hole in the data\n"); printf ("oggz_read_sync: hole in the data\n");
#endif #endif
result = ogg_stream_packetout(os, op); result = ogg_stream_packetout(os, op);
if (result == -1) { if (result == -1) {
...@@ -305,23 +305,23 @@ oggz_read_sync (OGGZ * oggz) ...@@ -305,23 +305,23 @@ oggz_read_sync (OGGZ * oggz)
if(result > 0){ if(result > 0){
int content; int content;
/* got a packet. process it */ /* got a packet. process it */
granulepos = op->granulepos; granulepos = op->granulepos;
content = oggz_stream_get_content(oggz, serialno); content = oggz_stream_get_content(oggz, serialno);
/* /*
* if we have no metrics for this stream yet, then generate them * if we have no metrics for this stream yet, then generate them
*/ */
if if
( (
(!stream->metric || (content == OGGZ_CONTENT_SKELETON)) (!stream->metric || (content == OGGZ_CONTENT_SKELETON))
&& &&
(oggz->flags & OGGZ_AUTO) (oggz->flags & OGGZ_AUTO)
) )
{ {
oggz_auto_get_granulerate (oggz, op, serialno, NULL); oggz_auto_get_granulerate (oggz, op, serialno, NULL);
} }
/* attempt to determine granulepos for this packet */ /* attempt to determine granulepos for this packet */
if (oggz->flags & OGGZ_AUTO) { if (oggz->flags & OGGZ_AUTO) {
...@@ -332,26 +332,26 @@ oggz_read_sync (OGGZ * oggz) ...@@ -332,26 +332,26 @@ oggz_read_sync (OGGZ * oggz)
} }
stream->last_granulepos = reader->current_granulepos; stream->last_granulepos = reader->current_granulepos;
/* set unit on last packet of page */ /* set unit on last packet of page */
if if
( (
(oggz->metric || stream->metric) && reader->current_granulepos != -1 (oggz->metric || stream->metric) && reader->current_granulepos != -1
) )
{ {
reader->current_unit = oggz_get_unit (oggz, serialno, reader->current_unit =
reader->current_granulepos); oggz_get_unit (oggz, serialno, reader->current_granulepos);
} }
if (stream->read_packet) { if (stream->read_packet) {
cb_ret = cb_ret =
stream->read_packet (oggz, op, serialno, stream->read_user_data); stream->read_packet (oggz, op, serialno, stream->read_user_data);
} else if (reader->read_packet) { } else if (reader->read_packet) {
cb_ret = cb_ret =
reader->read_packet (oggz, op, serialno, reader->read_user_data); reader->read_packet (oggz, op, serialno, reader->read_user_data);
} }
} }
else else
break; break;
} }
} }
...@@ -369,8 +369,8 @@ oggz_read_sync (OGGZ * oggz) ...@@ -369,8 +369,8 @@ oggz_read_sync (OGGZ * oggz)
if (stream == NULL) { if (stream == NULL) {
/* new stream ... check bos etc. */ /* new stream ... check bos etc. */
if ((stream = oggz_add_stream (oggz, serialno)) == NULL) { if ((stream = oggz_add_stream (oggz, serialno)) == NULL) {
/* error -- could not add stream */ /* error -- could not add stream */
return -7; return -7;
} }
/* identify stream type */ /* identify stream type */
...@@ -401,10 +401,10 @@ oggz_read_sync (OGGZ * oggz) ...@@ -401,10 +401,10 @@ oggz_read_sync (OGGZ * oggz)
if (stream->read_page) { if (stream->read_page) {
cb_ret = cb_ret =
stream->read_page (oggz, &og, serialno, stream->read_page_user_data); stream->read_page (oggz, &og, serialno, stream->read_page_user_data);
} else if (reader->read_page) { } else if (reader->read_page) {
cb_ret = reader->read_page (oggz, &og, serialno, cb_ret =
reader->read_page_user_data); reader->read_page (oggz, &og, serialno, reader->read_page_user_data);
} }
#if 0 #if 0
...@@ -449,7 +449,7 @@ oggz_read (OGGZ * oggz, long n) ...@@ -449,7 +449,7 @@ oggz_read (OGGZ * oggz, long n)
else { else {
#if 0 #if 0
printf ("oggz_read: EMPTY, current_unit %ld != 0\n", printf ("oggz_read: EMPTY, current_unit %ld != 0\n",
reader->current_unit); reader->current_unit);
return 0; return 0;
#endif #endif
} }
...@@ -457,7 +457,7 @@ oggz_read (OGGZ * oggz, long n) ...@@ -457,7 +457,7 @@ oggz_read (OGGZ * oggz, long n)
#endif #endif
while (cb_ret != OGGZ_STOP_ERR && cb_ret != OGGZ_STOP_OK && while (cb_ret != OGGZ_STOP_ERR && cb_ret != OGGZ_STOP_OK &&
bytes_read > 0 && remaining > 0) { bytes_read > 0 && remaining > 0) {
bytes = MIN (remaining, CHUNKSIZE); bytes = MIN (remaining, CHUNKSIZE);
buffer = ogg_sync_buffer (&reader->ogg_sync, bytes); buffer = ogg_sync_buffer (&reader->ogg_sync, bytes);
if ((bytes_read = (long) oggz_io_read (oggz, buffer, bytes)) == 0) { if ((bytes_read = (long) oggz_io_read (oggz, buffer, bytes)) == 0) {
...@@ -535,7 +535,7 @@ oggz_read_input (OGGZ * oggz, unsigned char * buf, long n) ...@@ -535,7 +535,7 @@ oggz_read_input (OGGZ * oggz, unsigned char * buf, long n)
#endif #endif
while (cb_ret != OGGZ_STOP_ERR && cb_ret != OGGZ_STOP_OK && while (cb_ret != OGGZ_STOP_ERR && cb_ret != OGGZ_STOP_OK &&
/* !oggz->eos && */ remaining > 0) { /* !oggz->eos && */ remaining > 0) {
bytes = MIN (remaining, 4096); bytes = MIN (remaining, 4096);
buffer = ogg_sync_buffer (&reader->ogg_sync, bytes); buffer = ogg_sync_buffer (&reader->ogg_sync, bytes);
memcpy (buffer, buf, bytes); memcpy (buffer, buf, bytes);
...@@ -585,7 +585,7 @@ oggz_read_close (OGGZ * oggz) ...@@ -585,7 +585,7 @@ oggz_read_close (OGGZ * oggz)
int int
oggz_set_read_callback (OGGZ * oggz, long serialno, oggz_set_read_callback (OGGZ * oggz, long serialno,
OggzReadPacket read_packet, void * user_data) OggzReadPacket read_packet, void * user_data)
{ {
return OGGZ_ERR_DISABLED; return OGGZ_ERR_DISABLED;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment