Permalink
Browse files

Double driver registering fix by autopune (not tested by me!)

  • Loading branch information...
denis111
denis111 committed Dec 3, 2007
1 parent f9ae1c2 commit 977a50f77136cdb0b05bb0125691169c89c28173
Showing with 8 additions and 2 deletions.
  1. +8 −2 playercode/mdriver.c
View
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mdriver.c,v 1.3 2006/08/08 00:06:31 realtech Exp $
+ $Id: mdriver.c,v 1.4 2007/12/03 20:59:05 denis111 Exp $
These routines are used to access the available soundcard drivers.
@@ -203,7 +203,13 @@ void _mm_registerdriver(struct MDRIVER* drv)
/* don't register a MISSING() driver */
if ((drv->Name) && (drv->Version)) {
if (cruise) {
- while (cruise->next) cruise = cruise->next;
+ if ( cruise == drv )
+ return;
+ while(cruise->next) {
+ cruise = cruise->next;
+ if ( cruise == drv )
+ return;
+ }
cruise->next = drv;
} else
firstdriver = drv;

0 comments on commit 977a50f

Please sign in to comment.