X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Falsa%2Fprotocol.c;h=70a5e68606905ebb9b7a75bd09c68b9b2a90b356;hb=aa7066353c9a54d90695fca3b303e1476dd772fd;hp=2d95f8cb17565977c08e84451976c5926bb3716a;hpb=69e19dd7691f86ac001469d1b319e1358e0d9778;p=libsigrok.git diff --git a/hardware/alsa/protocol.c b/hardware/alsa/protocol.c index 2d95f8cb..70a5e686 100644 --- a/hardware/alsa/protocol.c +++ b/hardware/alsa/protocol.c @@ -152,14 +152,14 @@ static void alsa_scan_handle_dev(GSList **devices, devc->num_probes = channels; devc->hw_params = hw_params; memcpy(devrates, hwrates, offset * sizeof(uint64_t)); - devc->supp_rates.list = devrates; + devc->samplerates = devrates; sdi->priv = devc; sdi->driver = di; for (i = 0; i < devc->num_probes; i++) { snprintf(p_name, sizeof(p_name), "Ch_%d", i); - if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, p_name))) + if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, p_name))) goto scan_error_cleanup; sdi->probes = g_slist_append(sdi->probes, probe); } @@ -294,7 +294,7 @@ SR_PRIV void alsa_dev_inst_clear(struct sr_dev_inst *sdi) return; snd_pcm_hw_params_free(devc->hw_params); - g_free((void*)devc->supp_rates.list); + g_free((void*)devc->samplerates); sr_dev_inst_free(sdi); } @@ -326,11 +326,11 @@ SR_PRIV int alsa_set_samplerate(const struct sr_dev_inst *sdi, i = 0; do { - if (newrate == devc->supp_rates.list[i]) { + if (newrate == devc->samplerates[i]) { rate = newrate; break; } - } while (devc->supp_rates.list[i++] != 0); + } while (devc->samplerates[i++] != 0); if (!rate) { sr_err("Sample rate %" PRIu64 " not supported.", newrate);