Mercurial > libavformat.hg
diff ogg.c @ 887:d70e50f1495f libavformat
COSMETICS: tabs --> spaces, some prettyprinting
| author | diego |
|---|---|
| date | Thu, 22 Dec 2005 01:10:11 +0000 |
| parents | da1d5db0ce5c |
| children | 801d4a5cf353 |
line wrap: on
line diff
--- a/ogg.c Mon Dec 19 20:49:00 2005 +0000 +++ b/ogg.c Thu Dec 22 01:10:11 2005 +0000 @@ -73,7 +73,7 @@ op->packetno++; //FIXME multiple streams } - context->header_handled = 0 ; + context->header_handled = 0 ; } return 0 ; @@ -94,12 +94,12 @@ /* flush header packets so audio starts on a new page */ if(!context->header_handled) { - while(ogg_stream_flush(&context->os, &og)) { - put_buffer(&avfcontext->pb, og.header, og.header_len) ; - put_buffer(&avfcontext->pb, og.body, og.body_len) ; - put_flush_packet(&avfcontext->pb); - } - context->header_handled = 1 ; + while(ogg_stream_flush(&context->os, &og)) { + put_buffer(&avfcontext->pb, og.header, og.header_len) ; + put_buffer(&avfcontext->pb, og.body, og.body_len) ; + put_flush_packet(&avfcontext->pb); + } + context->header_handled = 1 ; } op->packet = (uint8_t*) pkt->data; @@ -113,8 +113,8 @@ while(ogg_stream_pageout(&context->os, &og)) { put_buffer(&avfcontext->pb, og.header, og.header_len); - put_buffer(&avfcontext->pb, og.body, og.body_len); - put_flush_packet(&avfcontext->pb); + put_buffer(&avfcontext->pb, og.body, og.body_len); + put_flush_packet(&avfcontext->pb); } op->packetno++; @@ -127,9 +127,9 @@ ogg_page og ; while(ogg_stream_flush(&context->os, &og)) { - put_buffer(&avfcontext->pb, og.header, og.header_len) ; - put_buffer(&avfcontext->pb, og.body, og.body_len) ; - put_flush_packet(&avfcontext->pb); + put_buffer(&avfcontext->pb, og.header, og.header_len) ; + put_buffer(&avfcontext->pb, og.body, og.body_len) ; + put_flush_packet(&avfcontext->pb); } ogg_stream_clear(&context->os) ; @@ -159,17 +159,17 @@ while(ogg_stream_packetout(&context->os, op) != 1) { - /* while no pages are available, read in more data to the sync */ - while(ogg_sync_pageout(&context->oy, &og) != 1) { - buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ; - if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0) - return 1 ; - ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; - } + /* while no pages are available, read in more data to the sync */ + while(ogg_sync_pageout(&context->oy, &og) != 1) { + buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ; + if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0) + return 1 ; + ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; + } - /* got a page. Feed it into the stream and get the packet */ - if(ogg_stream_pagein(&context->os, &og) != 0) - return 1 ; + /* got a page. Feed it into the stream and get the packet */ + if(ogg_stream_pagein(&context->os, &og) != 0) + return 1 ; } return 0 ; @@ -191,7 +191,7 @@ buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ; if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0) - return AVERROR_IO ; + return AVERROR_IO ; ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; ogg_sync_pageout(&context->oy, &og) ; @@ -202,7 +202,7 @@ ast = av_new_stream(avfcontext, 0) ; if(!ast) - return AVERROR_NOMEM ; + return AVERROR_NOMEM ; av_set_pts_info(ast, 60, 1, AV_TIME_BASE); codec= &ast->codec; @@ -231,9 +231,9 @@ ogg_packet op ; if(next_packet(avfcontext, &op)) - return AVERROR_IO ; + return AVERROR_IO ; if(av_new_packet(pkt, op.bytes) < 0) - return AVERROR_IO ; + return AVERROR_IO ; pkt->stream_index = 0 ; memcpy(pkt->data, op.packet, op.bytes); if(avfcontext->streams[0]->codec.sample_rate && op.granulepos!=-1)
