---
 libavformat/gif.c |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/libavformat/gif.c b/libavformat/gif.c
index eb1e9f0..e124a6e 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -128,14 +128,14 @@ static int gif_image_write_header(AVIOContext *pb,
     /* the global palette */
     if (!palette) {
         avio_write(pb, (const unsigned char *)gif_clut, 216*3);
-        for(i=0;i<((256-216)*3);i++)
+        for (i = 0; i < ((256 - 216) * 3); i++)
             avio_w8(pb, 0);
     } else {
-        for(i=0;i<256;i++) {
+        for (i = 0; i < 256; i++) {
             v = palette[i];
             avio_w8(pb, (v >> 16) & 0xff);
-            avio_w8(pb, (v >> 8) & 0xff);
-            avio_w8(pb, (v) & 0xff);
+            avio_w8(pb, (v >> 8)  & 0xff);
+            avio_w8(pb,  v        & 0xff);
         }
     }
 
@@ -201,7 +201,7 @@ static int gif_image_write_image(AVIOContext *pb,
 
     avio_w8(pb, 0x08);
 
-    left= width * height;
+    left = width * height;
 
     init_put_bits(&p, buffer, 130);
 
@@ -210,27 +210,27 @@ static int gif_image_write_image(AVIOContext *pb,
  * but it's still the same bitstream between packets (no flush !)
  */
     ptr = buf;
-    w = width;
-    while(left>0) {
+    w   = width;
+    while (left > 0) {
 
         put_bits(&p, 9, 0x0100); /* clear code */
 
-        for(i=(left<GIF_CHUNKS)?left:GIF_CHUNKS;i;i--) {
+        for(i = (left < GIF_CHUNKS) ? left : GIF_CHUNKS; i; i--) {
             if (pix_fmt == PIX_FMT_RGB24) {
                 v = gif_clut_index(ptr[0], ptr[1], ptr[2]);
-                ptr+=3;
+                ptr += 3;
             } else {
                 v = *ptr++;
             }
             put_bits(&p, 9, v);
             if (--w == 0) {
-                w = width;
+                w    = width;
                 buf += linesize;
-                ptr = buf;
+                ptr  = buf;
             }
         }
 
-        if(left<=GIF_CHUNKS) {
+        if (left <= GIF_CHUNKS) {
             put_bits(&p, 9, 0x101); /* end of stream */
             flush_put_bits(&p);
         }
@@ -239,7 +239,7 @@ static int gif_image_write_image(AVIOContext *pb,
             avio_write(pb, p.buf, put_bits_ptr(&p) - p.buf); /* the actual 
buffer */
             p.buf_ptr = p.buf; /* dequeue the bytes off the bitstream */
         }
-        left-=GIF_CHUNKS;
+        left -= GIF_CHUNKS;
     }
     avio_w8(pb, 0x00); /* end of image block */
 
@@ -268,7 +268,7 @@ static int gif_write_header(AVFormatContext *s)
     gif->file_time = 0;
 
     video_enc = NULL;
-    for(i=0;i<s->nb_streams;i++) {
+    for (i = 0; i < s->nb_streams; i++) {
         enc = s->streams[i]->codec;
         if (enc->codec_type != AVMEDIA_TYPE_AUDIO)
             video_enc = enc;
@@ -278,7 +278,7 @@ static int gif_write_header(AVFormatContext *s)
         av_free(gif);
         return -1;
     } else {
-        width = video_enc->width;
+        width  = video_enc->width;
         height = video_enc->height;
 //        rate = video_enc->time_base.den;
     }
@@ -311,7 +311,7 @@ static int gif_write_video(AVFormatContext *s,
     /* XXX: should use delay, in order to be more accurate */
     /* instead of using the same rounded value each time */
     /* XXX: don't even remember if I really use it for now */
-    jiffies = (70*enc->time_base.num/enc->time_base.den) - 1;
+    jiffies = (70 * enc->time_base.num / enc->time_base.den) - 1;
 
     avio_wl16(pb, jiffies);
 
@@ -346,7 +346,8 @@ static int gif_write_trailer(AVFormatContext *s)
 #define OFFSET(x) offsetof(GIFContext, x)
 #define ENC AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-    { "loop", "Number of times to loop the output.", OFFSET(loop), 
AV_OPT_TYPE_INT, {0}, 0, 65535, ENC },
+    { "loop", "Number of times to loop the output.", OFFSET(loop),
+      AV_OPT_TYPE_INT, {0}, 0, 65535, ENC },
     { NULL },
 };
 
@@ -368,5 +369,5 @@ AVOutputFormat ff_gif_muxer = {
     .write_header      = gif_write_header,
     .write_packet      = gif_write_packet,
     .write_trailer     = gif_write_trailer,
-    .priv_class = &gif_muxer_class,
+    .priv_class        = &gif_muxer_class,
 };
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to