From: Jaroslav Kysela Date: Wed, 11 Aug 2004 15:09:05 +0000 (+0000) Subject: Fixed problem with the route plugin and ttable (an extra route plugin was X-Git-Tag: v1.0.6~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=06976cbcce9db885f5fbca929ca5839a40c4b96d;p=alsa-lib.git Fixed problem with the route plugin and ttable (an extra route plugin was inserted accidently). --- diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 1a6bbbb3..82a6a5f5 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -53,7 +53,7 @@ typedef struct { int srate; enum snd_pcm_plug_route_policy route_policy; snd_pcm_route_ttable_entry_t *ttable; - int ttable_ok; + int ttable_ok, ttable_last; unsigned int tt_ssize, tt_cused, tt_sused; } snd_pcm_plug_t; @@ -361,7 +361,8 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm snd_pcm_route_ttable_entry_t *ttable; int err; assert(snd_pcm_format_linear(slv->format)); - if (clt->channels == slv->channels && !plug->ttable) + if (clt->channels == slv->channels && + (!plug->ttable || !plug->ttable_last)) return 0; if (clt->rate != slv->rate && clt->channels > slv->channels) @@ -560,7 +561,7 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm, }; snd_pcm_plug_params_t p = *slave; unsigned int k = 0; - plug->ttable_ok = 0; + plug->ttable_ok = plug->ttable_last = 0; while (client->format != p.format || client->channels != p.channels || client->rate != p.rate || @@ -584,6 +585,7 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm, if (plug->ttable && !plug->ttable_ok) { snd_pcm_t *new; int err; + plug->ttable_last = 1; err = snd_pcm_plug_change_channels(pcm, &new, client, &p); if (err < 0) { snd_pcm_plug_clear(pcm);