Changeset 1318
- Timestamp:
- 01/26/08 14:18:29 (7 months ago)
- Location:
- portaudio/branches/v19-devel/src/hostapi/coreaudio
- Files:
-
- 3 modified
-
pa_mac_core.c (modified) (3 diffs)
-
pa_mac_core_utilities.c (modified) (7 diffs)
-
pa_mac_core_utilities.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
portaudio/branches/v19-devel/src/hostapi/coreaudio/pa_mac_core.c
r1316 r1318 938 938 kAudioDeviceProcessorOverload, 939 939 xrunCallback, 940 addToXRunListenerList( (void *)stream , *audioDevice) ) ;940 addToXRunListenerList( (void *)stream ) ) ; 941 941 if( result == kAudioHardwareIllegalOperationError ) { 942 942 // -- already registered, we're good … … 2128 2128 if( stream ) { 2129 2129 if( stream->outputUnit ) { 2130 int count = removeFromXRunListenerList( stream , stream->outputDevice);2130 int count = removeFromXRunListenerList( stream ); 2131 2131 if( count == 0 ) 2132 2132 AudioDeviceRemovePropertyListener( stream->outputDevice, … … 2137 2137 } 2138 2138 if( stream->inputUnit && stream->outputUnit != stream->inputUnit ) { 2139 int count = removeFromXRunListenerList( stream , stream->inputDevice);2139 int count = removeFromXRunListenerList( stream ); 2140 2140 if( count == 0 ) 2141 2141 AudioDeviceRemovePropertyListener( stream->inputDevice, -
portaudio/branches/v19-devel/src/hostapi/coreaudio/pa_mac_core_utilities.c
r1317 r1318 631 631 struct PaMacXRunListNode_s { 632 632 PaMacCoreStream *stream; 633 AudioDeviceID audioDevice;634 633 struct PaMacXRunListNode_s *next; 635 634 } ; … … 649 648 650 649 for( ; node; node=node->next ) { 651 if( node->audioDevice != inDevice )652 continue; //not the same device. continue.653 654 650 PaMacCoreStream *stream = node->stream; 655 651 … … 657 653 continue; //if the stream isn't active, we don't care if the device is dropping 658 654 659 if( isInput ) 660 OSAtomicOr32( paInputOverflow, (uint32_t *)&(stream->xrunFlags) ); 661 else 662 OSAtomicOr32( paOutputUnderflow, (uint32_t *)&(stream->xrunFlags) ); 655 if( isInput ) { 656 if( stream->inputDevice == inDevice ) 657 OSAtomicOr32( paInputOverflow, (uint32_t *)&(stream->xrunFlags) ); 658 } else { 659 if( stream->outputDevice == inDevice ) 660 OSAtomicOr32( paOutputUnderflow, (uint32_t *)&(stream->xrunFlags) ); 661 } 663 662 } 664 663 … … 688 687 } 689 688 690 void *addToXRunListenerList( void *stream , AudioDeviceID audioDevice)689 void *addToXRunListenerList( void *stream ) 691 690 { 692 691 PaMacXRunListNode *newNode; … … 694 693 newNode = (PaMacXRunListNode *) malloc( sizeof( PaMacXRunListNode ) ); 695 694 newNode->stream = (PaMacCoreStream *) stream; 696 newNode->audioDevice = audioDevice;697 695 newNode->next = firstXRunListNode.next; 698 696 // insert: … … 702 700 } 703 701 704 int removeFromXRunListenerList( void *stream , AudioDeviceID audioDevice)702 int removeFromXRunListenerList( void *stream ) 705 703 { 706 704 PaMacXRunListNode *node, *prev; … … 708 706 node = firstXRunListNode.next; 709 707 while( node ) { 710 if( node->stream == stream && node->audioDevice == audioDevice) {708 if( node->stream == stream ) { 711 709 //found it: 712 710 --xRunListSize; -
portaudio/branches/v19-devel/src/hostapi/coreaudio/pa_mac_core_utilities.h
r1316 r1318 222 222 223 223 /**Returns the list, so that it can be passed to CorAudio.*/ 224 void *addToXRunListenerList( void *stream , AudioDeviceID audioDevice);224 void *addToXRunListenerList( void *stream ); 225 225 /**Returns the number of Listeners in the list remaining.*/ 226 int removeFromXRunListenerList( void *stream , AudioDeviceID audioDevice);226 int removeFromXRunListenerList( void *stream ); 227 227 228 228 #endif /* PA_MAC_CORE_UTILITIES_H__*/
