Closed yuruxuan closed 4 years ago
for _, alt := range iface.AltSettings {
isVendorClass := alt.Class == gousb.ClassVendorSpec
isCorrectSubClass := alt.SubClass == subClass
log.Debugf("found: %t", isCorrectSubClass && isVendorClass)
}
isVendorClass := iface.AltSettings[0].Class == gousb.ClassVendorSpec
isCorrectSubClass := iface.AltSettings[0].SubClass == subClass
Thanks, good catch! You're absolutely right. I forgot to remove the old code that always used setting 0. I think it is actually not a big deal whether you just use the first setting or iterate them all as it seems there is usually only one setting present. Lopping through all of them just seems a little safer to me. I will add a fix soon. Thanks again for bringing this to my attention :-)
https://github.com/danielpaulus/quicktime_video_hack/blob/bfcee09d51933cc99006a85a093c425aa868efae/screencapture/discovery.go#L212
Is something wrong there?