diff options
author | Max Kellermann <max@duempel.org> | 2008-11-02 17:02:23 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-02 17:02:23 +0100 |
commit | 5b13f067cd38b23e567acf16fd8506dcbdad9b31 (patch) | |
tree | a0421061964b1d29fd2cf87eec5d6fd45842aee4 /src/decoder/aac_plugin.c | |
parent | 3f6fcfd38ebe115d1ba77a7e5b3c1c757b806814 (diff) | |
download | mpd-5b13f067cd38b23e567acf16fd8506dcbdad9b31.tar.gz mpd-5b13f067cd38b23e567acf16fd8506dcbdad9b31.tar.xz mpd-5b13f067cd38b23e567acf16fd8506dcbdad9b31.zip |
aac, mod: moved decoder command check into loop condition
Avoid while(true) loops, and convert them to a loop with a proper
condition.
Diffstat (limited to 'src/decoder/aac_plugin.c')
-rw-r--r-- | src/decoder/aac_plugin.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c index e7054b879..7961865b2 100644 --- a/src/decoder/aac_plugin.c +++ b/src/decoder/aac_plugin.c @@ -363,7 +363,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) advanceAacBuffer(&b, bread); - while (true) { + do { fillAacBuffer(&b); adts_find_frame(&b); fillAacBuffer(&b); @@ -414,9 +414,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) decoder_data(mpd_decoder, NULL, sampleBuffer, sampleBufferLen, file_time, bitRate, NULL); - if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) - break; - } + } while (decoder_get_command(mpd_decoder) == DECODE_COMMAND_NONE); faacDecClose(decoder); if (b.buffer) @@ -495,7 +493,7 @@ aac_decode(struct decoder *mpd_decoder, const char *path) advanceAacBuffer(&b, bread); - while (true) { + do { fillAacBuffer(&b); if (b.bytesIntoBuffer == 0) @@ -544,9 +542,7 @@ aac_decode(struct decoder *mpd_decoder, const char *path) decoder_data(mpd_decoder, NULL, sampleBuffer, sampleBufferLen, file_time, bitRate, NULL); - if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP) - break; - } + } while (decoder_get_command(mpd_decoder) == DECODE_COMMAND_NONE); faacDecClose(decoder); if (b.buffer) |