changeset 11766:01408f7d629c libavcodec

Cosmetics: reindent after the previous commit
author mstorsjo
date Tue, 25 May 2010 19:16:15 +0000
parents c96e649c4e0a
children 572bf2d9931e
files api-example.c
diffstat 1 files changed, 26 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/api-example.c	Tue May 25 19:13:28 2010 +0000
+++ b/api-example.c	Tue May 25 19:16:15 2010 +0000
@@ -157,34 +157,34 @@
 
     /* decode until eof */
     avpkt.data = inbuf;
-        avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
+    avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
 
-        while (avpkt.size > 0) {
-            out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-            len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
-            if (len < 0) {
-                fprintf(stderr, "Error while decoding\n");
-                exit(1);
-            }
-            if (out_size > 0) {
-                /* if a frame has been decoded, output it */
-                fwrite(outbuf, 1, out_size, outfile);
-            }
-            avpkt.size -= len;
-            avpkt.data += len;
-            if (avpkt.size < AUDIO_REFILL_THRESH) {
-                /* Refill the input buffer, to avoid trying to decode
-                 * incomplete frames. Instead of this, one could also use
-                 * a parser, or use a proper container format through
-                 * libavformat. */
-                memmove(inbuf, avpkt.data, avpkt.size);
-                avpkt.data = inbuf;
-                len = fread(avpkt.data + avpkt.size, 1,
-                            AUDIO_INBUF_SIZE - avpkt.size, f);
-                if (len > 0)
-                    avpkt.size += len;
-            }
+    while (avpkt.size > 0) {
+        out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+        len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
+        if (len < 0) {
+            fprintf(stderr, "Error while decoding\n");
+            exit(1);
+        }
+        if (out_size > 0) {
+            /* if a frame has been decoded, output it */
+            fwrite(outbuf, 1, out_size, outfile);
         }
+        avpkt.size -= len;
+        avpkt.data += len;
+        if (avpkt.size < AUDIO_REFILL_THRESH) {
+            /* Refill the input buffer, to avoid trying to decode
+             * incomplete frames. Instead of this, one could also use
+             * a parser, or use a proper container format through
+             * libavformat. */
+            memmove(inbuf, avpkt.data, avpkt.size);
+            avpkt.data = inbuf;
+            len = fread(avpkt.data + avpkt.size, 1,
+                        AUDIO_INBUF_SIZE - avpkt.size, f);
+            if (len > 0)
+                avpkt.size += len;
+        }
+    }
 
     fclose(outfile);
     fclose(f);