hal: fix fragment size calculation for compressed offload usecase

Compress offload fragment size is using duration_us provided in
offload info even if its set to -1, leading to incorrect and smaller
value which in turns results in higher power consumption.
Update check for duration us to exclude invalid values and use it for
calculating fragment size only if its within specified range.

Change-Id: Ib134a67d95fe663f5f77f688469bee1bf0ce1708
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 5cb1189..2b9e41d 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -8057,7 +8057,9 @@
     }
 
     /* Use client specified buffer size if mentioned */
-    if ((info != NULL) && (info->duration_us > 0)) {
+    if ((info != NULL) &&
+        (info->duration_us >= MIN_OFFLOAD_BUFFER_DURATION_MS) &&
+        (info->duration_us <= MAX_OFFLOAD_BUFFER_DURATION_MS)) {
         duration_ms = info->duration_us / 1000;
         channel_count = audio_channel_count_from_in_mask(info->channel_mask);