This patch is all wrong. It makes no sense to pass a software class id to a function that only accepts hardware ids. The real bug is in the class factory. 0 should be passed rather than the class id. Look at the capture part a few lines below it. Passing 0 or NULL will select the default device.
I can't generate a patch now but the trivial fix is to pass 0 rather than the class id in the class factory.
Bob.