### patch number: 13 ### area: Alofi. Fixes hifi record reference counts (optimization). ### severity: medium. ### comments: patch using command "(cd ; patch -p < thisfile)" *** ./patchlevel.h Wed Mar 3 16:02:55 1993 --- /crl/audio/./patchlevel.h Fri Mar 5 11:30:15 1993 *************** *** 1 **** ! #define PATCHLEVEL 12 --- 1 ---- ! #define PATCHLEVEL 13 *** ./AF/server/dda/lofi/hifi.c Sun Feb 7 19:52:37 1993 --- /crl/audio/./AF/server/dda/lofi/hifi.c Mon Mar 8 10:37:27 1993 *************** *** 38,44 **** * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char pscodec_c_rcsid[] = "$Header: /crl/audio/AF/server/dda/lofi/RCS/hifi.c,v 1.11 1993/02/08 00:52:37 stewart Exp $"; #endif /* !lint && !SABER */ #include --- 38,44 ---- * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char pscodec_c_rcsid[] = "$Header: /crl/audio/AF/server/dda/lofi/RCS/hifi.c,v 1.12 1993/03/08 15:37:17 payne Exp $"; #endif /* !lint && !SABER */ #include *************** *** 111,120 **** return hPtr->prim->time0; } void hifiDestroyAC(ACPtr pAC) { if(pAC->recRef) ! pAC->aDev->recRefCount--; xfree(pAC->funcs); xfree(pAC->ops); --- 111,127 ---- return hPtr->prim->time0; } + /* + Destroy an audio context. If a record was done on this context, then + decrement the reference count for the *primary* device. + */ void hifiDestroyAC(ACPtr pAC) { + HiFiPrivate *hPtr = (HiFiPrivate *) pAC->aDev->privPtr; + AudioDevicePtr prim=hPtr->prim; + if(pAC->recRef) ! prim->recRefCount--; xfree(pAC->funcs); xfree(pAC->ops); *************** *** 226,232 **** } /* move record data */ ! if(aDev->recRefCount) hifiRecUpdate(aDev); } --- 233,239 ---- } /* move record data */ ! if(aDev->recRefCount) hifiRecUpdate(aDev); }