audiod: Improve receiver restart logic.
[paraslash.git] / afh_common.c
index f7066cfc23e9246b707ad51fe4aa42681fe497d1..aa7f3d92444faddf9d193aa6c2b86fe04b697d14 100644 (file)
@@ -233,6 +233,15 @@ void afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi,
        *len = afhi->chunk_table[chunk_num + 1] - pos;
 }
 
+uint32_t afh_get_largest_chunk_size(struct afh_info *afhi)
+{
+       uint32_t n, largest = 0, *ct = afhi->chunk_table;
+
+       for (n = 1; n <= afhi->chunks_total; n++)
+               largest = PARA_MAX(largest, ct[n] - ct[n - 1]);
+       return largest;
+}
+
 /**
  * Get the header of an audio file.
  *