alsa/0031-pcm-recalculate-all-rules-after-changing-hw_params-f.patch
Ismail Dönmez b35a2527db Accepting request 85033 from home:tiwai:branches:multimedia:libs
- backport upstream fixes: fix noresample hw_params rule and a few
  fixes for missing free()

OBS-URL: https://build.opensuse.org/request/show/85033
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=95
2011-09-27 11:08:17 +00:00

53 lines
1.8 KiB
Diff

From 6dab1a91cbbd40d2f52a0c5a1bd961a1db7bb319 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens@ladisch.de>
Date: Wed, 21 Sep 2011 08:30:20 +0200
Subject: [PATCH 1/5] pcm: recalculate all rules after changing hw_params
flags
The rules engine avoids recalculating rules that do not depend on
any changed parameter, but there is no mechanism to record changed
flags. So when we change a flag, we have to ensure that all rules
depending on that flag are recalculated; the only method to do this
is to force recalculation of all rules.
So far, there have been no kernel drivers with rules depending
on flags, but rules to disable hardware SRCs by setting
SND_PCM_HW_PARAMS_NORESAMPLE are being introduced now.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
src/pcm/pcm.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 12f8cd0..bc5c6e4 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -4200,6 +4200,7 @@ int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
params->flags |= SND_PCM_HW_PARAMS_NORESAMPLE;
else
params->flags &= ~SND_PCM_HW_PARAMS_NORESAMPLE;
+ params->rmask = ~0;
return snd_pcm_hw_refine(pcm, params);
}
@@ -4231,6 +4232,7 @@ int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
params->flags |= SND_PCM_HW_PARAMS_EXPORT_BUFFER;
else
params->flags &= ~SND_PCM_HW_PARAMS_EXPORT_BUFFER;
+ params->rmask = ~0;
return snd_pcm_hw_refine(pcm, params);
}
@@ -4280,6 +4282,7 @@ int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
params->flags |= SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
} else
params->flags &= ~SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+ params->rmask = ~0;
return snd_pcm_hw_refine(pcm, params);
}
--
1.7.6.1