output/osx: convert int
to size_t
This commit is contained in:
parent
a7b30fcb9e
commit
931c3a1de0
@ -389,7 +389,7 @@ osx_output_set_device_format(AudioDeviceID dev_id, const AudioStreamBasicDescrip
|
|||||||
throw FormatRuntimeError("Cannot get number of streams: %d\n", err);
|
throw FormatRuntimeError("Cannot get number of streams: %d\n", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
int n_streams = property_size / sizeof(AudioStreamID);
|
const size_t n_streams = property_size / sizeof(AudioStreamID);
|
||||||
AudioStreamID streams[n_streams];
|
AudioStreamID streams[n_streams];
|
||||||
err = AudioObjectGetPropertyData(dev_id, &aopa, 0, NULL, &property_size, streams);
|
err = AudioObjectGetPropertyData(dev_id, &aopa, 0, NULL, &property_size, streams);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
@ -400,7 +400,7 @@ osx_output_set_device_format(AudioDeviceID dev_id, const AudioStreamBasicDescrip
|
|||||||
int output_stream;
|
int output_stream;
|
||||||
AudioStreamBasicDescription output_format;
|
AudioStreamBasicDescription output_format;
|
||||||
|
|
||||||
for (int i = 0; i < n_streams; i++) {
|
for (size_t i = 0; i < n_streams; i++) {
|
||||||
UInt32 direction;
|
UInt32 direction;
|
||||||
AudioStreamID stream = streams[i];
|
AudioStreamID stream = streams[i];
|
||||||
aopa.mSelector = kAudioStreamPropertyDirection;
|
aopa.mSelector = kAudioStreamPropertyDirection;
|
||||||
@ -423,14 +423,14 @@ osx_output_set_device_format(AudioDeviceID dev_id, const AudioStreamBasicDescrip
|
|||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
throw FormatRuntimeError("Unable to get format size s for stream %d. Error = %s", streams[i], err);
|
throw FormatRuntimeError("Unable to get format size s for stream %d. Error = %s", streams[i], err);
|
||||||
|
|
||||||
int format_count = property_size / sizeof(AudioStreamRangedDescription);
|
const size_t format_count = property_size / sizeof(AudioStreamRangedDescription);
|
||||||
AudioStreamRangedDescription format_list[format_count];
|
AudioStreamRangedDescription format_list[format_count];
|
||||||
err = AudioObjectGetPropertyData(stream, &aopa, 0, NULL, &property_size, format_list);
|
err = AudioObjectGetPropertyData(stream, &aopa, 0, NULL, &property_size, format_list);
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
throw FormatRuntimeError("Unable to get available formats for stream %d. Error = %s", streams[i], err);
|
throw FormatRuntimeError("Unable to get available formats for stream %d. Error = %s", streams[i], err);
|
||||||
|
|
||||||
float output_score = 0;
|
float output_score = 0;
|
||||||
for (int j = 0; j < format_count; j++) {
|
for (size_t j = 0; j < format_count; j++) {
|
||||||
AudioStreamBasicDescription format_desc = format_list[j].mFormat;
|
AudioStreamBasicDescription format_desc = format_list[j].mFormat;
|
||||||
std::string format_string;
|
std::string format_string;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user