summaryrefslogtreecommitdiffstats
path: root/audio/audio_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'audio/audio_template.h')
-rw-r--r--audio/audio_template.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 98ab557684..720a32e57e 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -110,7 +110,11 @@ static int glue (audio_pcm_sw_alloc_resources_, TYPE) (SW *sw)
return 0;
}
+#ifdef DAC
samples = ((int64_t) sw->HWBUF->size << 32) / sw->ratio;
+#else
+ samples = (int64_t)sw->HWBUF->size * sw->ratio >> 32;
+#endif
sw->buf = audio_calloc(__func__, samples, sizeof(struct st_sample));
if (!sw->buf) {