Better pcm_type deduction in alsamixer_getvolume

Closes #87
This commit is contained in:
Lars Immisch
2020-07-16 23:36:50 +02:00
parent 4018ab4f6c
commit 0ae60f80f3
+9
View File
@@ -1977,6 +1977,15 @@ alsamixer_getvolume(alsamixer_t *self, PyObject *args)
elem = alsamixer_find_elem(self->handle,self->controlname,self->controlid);
if (!pcmtypeobj || (pcmtypeobj == Py_None)) {
if (self->pchannels) {
pcmtype = SND_PCM_STREAM_PLAYBACK;
}
}
else {
pcmtype = SND_PCM_STREAM_CAPTURE;
}
result = PyList_New(0);
for (channel = 0; channel <= SND_MIXER_SCHN_LAST; channel++) {