Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify EZAudioDevice internal implementation #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions EZAudio/EZAudioDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ + (void)enumerateInputDevicesUsingBlock:(void (^)(EZAudioDevice *, BOOL *))block
return;
}

BOOL stop;
BOOL stop = NO;
for (AVAudioSessionPortDescription *inputDevicePortDescription in inputs)
{
// add any additional sub-devices
Expand All @@ -130,6 +130,10 @@ + (void)enumerateInputDevicesUsingBlock:(void (^)(EZAudioDevice *, BOOL *))block
device.port = inputDevicePortDescription;
device.dataSource = inputDeviceDataSourceDescription;
block(device, &stop);
if (stop)
{
break;
}
}
}
else
Expand All @@ -153,7 +157,7 @@ + (void)enumerateOutputDevicesUsingBlock:(void (^)(EZAudioDevice *, BOOL *))bloc
AVAudioSessionRouteDescription *currentRoute = [[AVAudioSession sharedInstance] currentRoute];
NSArray *portDescriptions = [currentRoute outputs];

BOOL stop;
BOOL stop = NO;
for (AVAudioSessionPortDescription *outputDevicePortDescription in portDescriptions)
{
// add any additional sub-devices
Expand All @@ -166,6 +170,10 @@ + (void)enumerateOutputDevicesUsingBlock:(void (^)(EZAudioDevice *, BOOL *))bloc
device.port = outputDevicePortDescription;
device.dataSource = outputDeviceDataSourceDescription;
block(device, &stop);
if (stop)
{
break;
}
}
}
else
Expand Down