Commit f27d4524 authored by mstorsjo's avatar mstorsjo

Cosmetics: reindent after the previous commit


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23324 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e5b129ee
...@@ -157,34 +157,34 @@ static void audio_decode_example(const char *outfilename, const char *filename) ...@@ -157,34 +157,34 @@ static void audio_decode_example(const char *outfilename, const char *filename)
/* decode until eof */ /* decode until eof */
avpkt.data = inbuf; 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) { while (avpkt.size > 0) {
out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt); len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
if (len < 0) { if (len < 0) {
fprintf(stderr, "Error while decoding\n"); fprintf(stderr, "Error while decoding\n");
exit(1); 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;
}
} }
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(outfile);
fclose(f); fclose(f);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment