alsa/0007-namehint-Don-t-enumerate-as-duplex-if-only-a-single-.patch
Ismail Dönmez d51e946615 Accepting request 400689 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes: fixing PCM dmix & co suspend/resume,
  namehint parser fixes, stackable async handler:
  0007-namehint-Don-t-enumerate-as-duplex-if-only-a-single-.patch
  0008-pcm-Define-namehint-for-single-directional-PCM-types.patch
  0009-conf-Add-thread-safe-global-tree-reference.patch
  0010-pcm-Remove-resume-support-from-dmix-co.patch
  0011-pcm-Fix-secondary-retry-in-dsnoop-and-dshare.patch
  0012-pcm-dmix-resume-workaround-for-buggy-driver.patch
  0013-pcm-dmix-Prepare-slave-when-it-s-in-SETUP-too.patch
  0014-pcm-dmix-Return-error-when-slave-is-in-OPEN-or-DISCO.patch
  0015-async-Handle-previously-installed-signal-handler.patch

OBS-URL: https://build.opensuse.org/request/show/400689
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=198
2016-06-08 17:12:10 +00:00

63 lines
2.0 KiB
Diff

From 8cdbdae73109c901aec4984f6ba65e5b25722f13 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 12 May 2016 16:30:44 +0200
Subject: [PATCH 07/15] namehint: Don't enumerate as duplex if only a single
direction is defined
When a hint description has only either device_input or device_output,
we shouldn't handle it as a full duplex but rather a single
direction. In that way, we can avoid to list up a playback stream
like dmix or surround51 as a capture stream in the namehint.
Reported-by: Trent Reed <treed0803@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/namehint.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/control/namehint.c b/src/control/namehint.c
index 856957c76d74..ad8dda37a637 100644
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -28,6 +28,7 @@
#include "local.h"
#ifndef DOC_HIDDEN
+#define DEV_SKIP 9999 /* some non-existing device number */
struct hint_list {
char **list;
unsigned int count;
@@ -90,7 +91,7 @@ static int get_dev_name1(struct hint_list *list, char **res, int device,
int stream)
{
*res = NULL;
- if (device < 0)
+ if (device < 0 || device == DEV_SKIP)
return 0;
switch (list->iface) {
#ifdef BUILD_HWDEP
@@ -317,7 +318,9 @@ static int try_config(snd_config_t *config,
err = -EINVAL;
goto __cleanup;
}
- list->device_output = -1;
+ /* skip the counterpart if only a single direction is defined */
+ if (list->device_output < 0)
+ list->device_output = DEV_SKIP;
}
if (snd_config_search(cfg, "device_output", &n) >= 0) {
if (snd_config_get_integer(n, &list->device_output) < 0) {
@@ -325,6 +328,9 @@ static int try_config(snd_config_t *config,
err = -EINVAL;
goto __cleanup;
}
+ /* skip the counterpart if only a single direction is defined */
+ if (list->device_input < 0)
+ list->device_input = DEV_SKIP;
}
} else if (level == 1 && !list->show_all)
goto __skip_add;
--
2.8.3