I'm attaching a diff with my code for loop detection. I've also kept the magic-number-1024-timeout, but I guess people aren't so happy about that ;-)

Anyway, the 1024 timeout doesn't trigger now, as can be seen from this log:
Interestingly enough it only escapes from _one_ single loop, but it also fails in another way, that I've called "Erroneous connection list - part 2".

I've tried my very best to keep it ANSI C - oh how I would have loved to be able to do it OO!
Have a look at it, please.

// Lasse

"There is a crack in everything, that's how the light gets in." - L. Cohen

On Mon, Sep 23, 2013 at 10:58 AM, Leland <leland@audacityteam.org> wrote:
On 9/23/2013 2:53 AM, Lasse Steen Bohnstedt wrote:
There's a problem with Leland's loop-detection in GetConnectedPin(..) - it prevents Audacity from finding all devices on my system - and those found have "generic" names (fx "input" and "output" rather than "microphone" and "speaker").
So, my suspicions mentioned here:


were correct.

Also I suppose the loop-detection has a memory leak as it doesn't clean up the array it creates (very minor problem).
Yep, never said it was complete...just asked for assistance in testing.
So should I try to refine the loop detection? It would be quite straightforward but still some coding required because it would mean testing values of several other variables besides the _conn_ variable.
On the other hand the timeout-with-the-magic-number version is a no-brainer - and it might be better to keep it simple?
What say you?
Absolutely continue on if you have the time.  You're about our best bet in getting this resolved properly.  Sure, the artificial limiter is okay (a "similar" limiter is already doing in the WDMKS code), but it would be nice to understand and resolve that actual problem.


LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
audacity-devel mailing list