View | Details | Raw Unified | Return to bug 208570 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-2 / +52 lines)
Line 377 Link Here
377
378
	// Now find aliases...
379
	int res;
380
	snd_config_iterator_t pos, next;
381
	snd_config_t *top, *node, *tp;
382
	snd_pcm_t *pcm;
383
	snd_pcm_stream_t st;
384
	const char *tps, *ids, **ig;
385
	static const char *ignore[] = {"hw", "plughw", "plug", "dsnoop", "tee",
386
			"file", "null", "shm", "cards", "rate_convert", NULL};
387
388
	// Populate snd_config...
389
	if (snd_config == NULL)
390
		snd_config_update();
391
	if (snd_config != NULL) {
392
		switch (mode) {
393
			case QAudio::AudioInput:
394
				st = SND_PCM_STREAM_CAPTURE;
395
				break;
396
			case QAudio::AudioOutput:
397
				st = SND_PCM_STREAM_PLAYBACK;
398
				break;
399
			default:
400
				goto bad_mode;
401
		}
402
		// Find "pcm" nodes...
403
		if ((res = snd_config_search(snd_config, "pcm", &top)) >= 0) {
404
			for (pos = snd_config_iterator_first(top), next = snd_config_iterator_next(pos);
405
				 pos != snd_config_iterator_end(top);
406
				 pos = next, next = snd_config_iterator_next(pos)) {
407
				node = snd_config_iterator_entry(pos);
408
				if (snd_config_search(node, "type", &tp) < 0)
409
					continue;
410
				snd_config_get_string(tp, &tps);
411
				snd_config_get_id(node, &ids);
412
				for (ig = ignore; *ig; ig++) {
413
					if (strcmp(*ig, ids) == 0)
414
						break;
415
				}
416
				if (*ig)
417
					continue;
418
				// Ensure it's available...
419
				if (snd_pcm_open(&pcm, ids, st, 0))
420
					continue;
421
				snd_pcm_close(pcm);
422
				QString deviceName = QLatin1String(ids);
423
				devices.append(deviceName.toLocal8Bit().constData());
424
			}
425
		}
426
	}
427
bad_mode:
Line 387 Link Here
387
    if (devices.size() > 0)
438
	if (devices.size() > 0 && !devices.contains("default"))
388
--

Return to bug 208570