pcm_mixer: Get default sample rate from pcm layer.

Change-Id: I6eccb37556e70f23112bbb0e26f4a45ac0930245
This commit is contained in:
Solomon Peachy 2026-03-28 08:14:52 -04:00
parent 759ef2767a
commit daef425c59

View file

@ -33,7 +33,7 @@
before the last samples are sent to the codec and so things are done in
parallel (as much as possible) with sending-out data. */
static unsigned int mixer_sampr = HW_SAMPR_DEFAULT;
static unsigned int mixer_sampr = -1UL;
static unsigned int mix_frame_size = MIX_FRAME_SAMPLES*4;
/* Define this to nonzero to add a marker pulse at each frame start */
@ -266,6 +266,9 @@ static void mixer_start_pcm(void)
#endif
/* Requires a shared global sample rate for all channels */
if (mixer_sampr == -1UL)
mixer_sampr = pcm_get_frequency();
else
pcm_set_frequency(mixer_sampr);
/* Prepare initial frames and set up the double buffer */