vss: need_audio_header(): Change return value to bool.
[paraslash.git] / aacdec_filter.c
index 2dd68448b3b130172ba3417cb20eedcfc1fff262..1127fc1132b90d56169c34d732c9343e47e8fa43 100644 (file)
@@ -100,7 +100,7 @@ next_buffer:
                return;
        btr_merge(btrn, fn->min_iqs);
        len = btr_next_buffer(btrn, (char **)&inbuf);
-       len = PARA_MAX(len, (size_t)8192);
+       len = PARA_MIN(len, (size_t)8192);
        consumed = 0;
        iqs = btr_get_input_queue_size(btrn);
        if (!padd->initialized) {
@@ -174,7 +174,8 @@ next_buffer:
                        padd->frame_info.bytesconsumed);
                PARA_ERROR_LOG("%s\n", NeAACDecGetErrorMessage(
                        padd->frame_info.error));
-               consumed++; /* catch 21 */
+               if (consumed < len)
+                       consumed++; /* catch 21 */
                goto success;
        }
        padd->error_count = 0;