If you try to use QAudioInputSelectorControl with the iOS Simulator then
it would crash as there is no camera device available. This prevents a
crash from happening in that case.
Change-Id: I3904f3d299a11a6df21e66a1138a4319cc0b8a5c
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
QString::fromUtf8([[device localizedName] UTF8String]));
}
- m_activeInput = m_devices.first();
+ if (m_devices.size() > 0)
+ m_activeInput = m_devices.first();
}
AVFAudioInputSelectorControl::~AVFAudioInputSelectorControl()
QString AVFAudioInputSelectorControl::defaultInput() const
{
- return m_devices.first();
+ return m_devices.size() > 0 ? m_devices.first() : QString();
}
QString AVFAudioInputSelectorControl::activeInput() const