diff options
author | Martin Storsjö <martin@martin.st> | 2010-05-25 19:16:15 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-05-25 19:16:15 +0000 |
commit | 8ac942d8f5b8d104448b52c543d99df50e1db0f9 (patch) | |
tree | 5e0b368b4995bae1111a8659fef15e263c1e1b9b | |
parent | 11f6181af18a7deab3dc97caf864a00a2a017961 (diff) | |
download | ffmpeg-8ac942d8f5b8d104448b52c543d99df50e1db0f9.tar.gz |
Cosmetics: reindent after the previous commit
Originally committed as revision 23324 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/api-example.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c index cde8dc3524..f34075e666 100644 --- a/libavcodec/api-example.c +++ b/libavcodec/api-example.c @@ -157,34 +157,34 @@ static void audio_decode_example(const char *outfilename, const char *filename) /* decode until eof */ avpkt.data = inbuf; - 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; - } + 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; + } + } fclose(outfile); fclose(f); |