changeset 5127:e73c5f33463b libavformat

cosmetics: whitespace, prettyprinting, coding style fixes
author diego
date Mon, 10 Aug 2009 16:35:36 +0000
parents 789e13163b3b
children 2397bd089f70
files wav.c
diffstat 1 files changed, 29 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/wav.c	Mon Aug 10 16:27:33 2009 +0000
+++ b/wav.c	Mon Aug 10 16:35:36 2009 +0000
@@ -55,8 +55,8 @@
     }
     ff_end_tag(pb, fmt);
 
-    if(s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
-       && !url_is_streamed(s->pb)) {
+    if (s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
+        && !url_is_streamed(s->pb)) {
         fact = ff_start_tag(pb, "fact");
         put_le32(pb, 0);
         ff_end_tag(pb, fact);
@@ -76,12 +76,12 @@
 
 static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    ByteIOContext *pb = s->pb;
-    WAVContext *wav = s->priv_data;
+    ByteIOContext *pb  = s->pb;
+    WAVContext    *wav = s->priv_data;
     put_buffer(pb, pkt->data, pkt->size);
     if(pkt->pts != AV_NOPTS_VALUE) {
-        wav->minpts = FFMIN(wav->minpts, pkt->pts);
-        wav->maxpts = FFMAX(wav->maxpts, pkt->pts);
+        wav->minpts        = FFMIN(wav->minpts, pkt->pts);
+        wav->maxpts        = FFMAX(wav->maxpts, pkt->pts);
         wav->last_duration = pkt->duration;
     } else
         av_log(s, AV_LOG_ERROR, "wav_write_packet: NOPTS\n");
@@ -90,8 +90,8 @@
 
 static int wav_write_trailer(AVFormatContext *s)
 {
-    ByteIOContext *pb = s->pb;
-    WAVContext *wav = s->priv_data;
+    ByteIOContext *pb  = s->pb;
+    WAVContext    *wav = s->priv_data;
     int64_t file_size;
 
     if (!url_is_streamed(s->pb)) {
@@ -127,10 +127,10 @@
     unsigned int tag;
     int64_t size;
 
-    for(;;) {
+    for (;;) {
         if (url_feof(pb))
             return -1;
-        tag = get_le32(pb);
+        tag  = get_le32(pb);
         size = get_le32(pb);
         if (tag == tag1)
             break;
@@ -144,9 +144,9 @@
     /* check file header */
     if (p->buf_size <= 32)
         return 0;
-    if (p->buf[0] == 'R' && p->buf[1] == 'I' &&
-        p->buf[2] == 'F' && p->buf[3] == 'F' &&
-        p->buf[8] == 'W' && p->buf[9] == 'A' &&
+    if (p->buf[ 0] == 'R' && p->buf[ 1] == 'I' &&
+        p->buf[ 2] == 'F' && p->buf[ 3] == 'F' &&
+        p->buf[ 8] == 'W' && p->buf[ 9] == 'A' &&
         p->buf[10] == 'V' && p->buf[11] == 'E')
         /*
           Since ACT demuxer has standard WAV header at top of it's own,
@@ -217,9 +217,9 @@
     if (p->buf_size <= 40)
         return 0;
     if (!memcmp(p->buf,      guid_riff, 16) &&
-        !memcmp(p->buf + 24, guid_wave, 16)) {
+        !memcmp(p->buf + 24, guid_wave, 16))
         return AVPROBE_SCORE_MAX;
-    } else
+    else
         return 0;
 }
 
@@ -246,8 +246,8 @@
 static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     int64_t size;
-    ByteIOContext *pb = s->pb;
-    WAVContext *wav   = s->priv_data;
+    ByteIOContext *pb  = s->pb;
+    WAVContext    *wav = s->priv_data;
     AVStream *st;
     uint8_t guid[16];
 
@@ -288,7 +288,7 @@
         return -1;
     }
     wav->data_end = url_ftell(pb) + size - 24;
-    wav->w64 = 1;
+    wav->w64      = 1;
 
     return 0;
 }
@@ -308,15 +308,14 @@
         return AVERROR(EIO);
     st = s->streams[0];
 
-    left= wav->data_end - url_ftell(s->pb);
-    if(left <= 0){
-        if (CONFIG_W64_DEMUXER && wav->w64) {
+    left = wav->data_end - url_ftell(s->pb);
+    if (left <= 0){
+        if (CONFIG_W64_DEMUXER && wav->w64)
             left = find_guid(s->pb, guid_data) - 24;
-        } else
-        left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
-        if (left < 0) {
+        else
+            left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
+        if (left < 0)
             return AVERROR(EIO);
-        }
         wav->data_end= url_ftell(s->pb) + left;
     }
 
@@ -326,8 +325,8 @@
             size = st->codec->block_align;
         size = (size / st->codec->block_align) * st->codec->block_align;
     }
-    size= FFMIN(size, left);
-    ret= av_get_packet(s->pb, pkt, size);
+    size = FFMIN(size, left);
+    ret  = av_get_packet(s->pb, pkt, size);
     if (ret <= 0)
         return AVERROR(EIO);
     pkt->stream_index = 0;
@@ -344,7 +343,7 @@
     AVStream *st;
 
     st = s->streams[0];
-    switch(st->codec->codec_id) {
+    switch (st->codec->codec_id) {
     case CODEC_ID_MP2:
     case CODEC_ID_MP3:
     case CODEC_ID_AC3:
@@ -371,6 +370,7 @@
     .codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
 };
 #endif
+
 #if CONFIG_WAV_MUXER
 AVOutputFormat wav_muxer = {
     "wav",
@@ -386,6 +386,7 @@
     .codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
 };
 #endif
+
 #if CONFIG_W64_DEMUXER
 AVInputFormat w64_demuxer = {
     "w64",