Mercurial > libavformat.hg
diff ogg.c @ 885:da1d5db0ce5c libavformat
COSMETICS: Remove all trailing whitespace.
| author | diego |
|---|---|
| date | Sat, 17 Dec 2005 18:14:38 +0000 |
| parents | 2ece9c9dd94c |
| children | d70e50f1495f |
line wrap: on
line diff
--- a/ogg.c Sat Dec 17 17:57:03 2005 +0000 +++ b/ogg.c Sat Dec 17 18:14:38 2005 +0000 @@ -30,14 +30,14 @@ #ifdef CONFIG_MUXERS -static int ogg_write_header(AVFormatContext *avfcontext) +static int ogg_write_header(AVFormatContext *avfcontext) { OggContext *context = avfcontext->priv_data; - ogg_packet *op= &context->op; + ogg_packet *op= &context->op; int n; ogg_stream_init(&context->os, 31415); - + for(n = 0 ; n < avfcontext->nb_streams ; n++) { AVCodecContext *codec = avfcontext->streams[n]->codec; uint8_t *headers = codec->extradata; @@ -45,7 +45,7 @@ uint8_t *header_start[3]; int header_len[3]; int i, j; - + av_set_pts_info(avfcontext->streams[n], 60, 1, AV_TIME_BASE); for(j=1,i=0;i<2;++i, ++j) { @@ -75,7 +75,7 @@ context->header_handled = 0 ; } - + return 0 ; } @@ -108,14 +108,14 @@ op->granulepos= pts; /* correct the fields in the packet -- essential for streaming */ - - ogg_stream_packetin(&context->os, op); - + + ogg_stream_packetin(&context->os, op); + 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_buffer(&avfcontext->pb, og.body, og.body_len); put_flush_packet(&avfcontext->pb); - } + } op->packetno++; return 0; @@ -164,9 +164,9 @@ 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) ; - } - + 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 ; @@ -179,25 +179,25 @@ static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap) { OggContext *context = avfcontext->priv_data; - ogg_packet op ; + ogg_packet op ; char *buf ; ogg_page og ; AVStream *ast ; AVCodecContext *codec; uint8_t *p; int i; - + ogg_sync_init(&context->oy) ; buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ; if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0) return AVERROR_IO ; - - ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; + + ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; ogg_sync_pageout(&context->oy, &og) ; ogg_stream_init(&context->os, ogg_page_serialno(&og)) ; ogg_stream_pagein(&context->os, &og) ; - + /* currently only one vorbis stream supported */ ast = av_new_stream(avfcontext, 0) ; @@ -230,7 +230,7 @@ static int ogg_read_packet(AVFormatContext *avfcontext, AVPacket *pkt) { ogg_packet op ; - if(next_packet(avfcontext, &op)) + if(next_packet(avfcontext, &op)) return AVERROR_IO ; if(av_new_packet(pkt, op.bytes) < 0) return AVERROR_IO ;
