mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
Implement media device tracking on macOS.
This commit is contained in:
@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "media/audio/media_audio_track.h"
|
||||
#include "media/media_common.h"
|
||||
#include "media/streaming/media_streaming_utility.h"
|
||||
#include "webrtc/webrtc_environment.h"
|
||||
#include "webrtc/webrtc_media_devices.h"
|
||||
#include "data/data_document.h"
|
||||
#include "data/data_file_origin.h"
|
||||
@@ -144,8 +145,11 @@ bool CreatePlaybackDevice() {
|
||||
const auto id = Current().deviceId().toStdString();
|
||||
AudioDevice = alcOpenDevice(id.c_str());
|
||||
if (!AudioDevice) {
|
||||
LOG(("Audio Error: Could not create default playback device, enumerating.."));
|
||||
EnumeratePlaybackDevices();
|
||||
LOG(("Audio Error: Could not create default playback device, refreshing.."));
|
||||
crl::on_main([] {
|
||||
const auto type = Webrtc::DeviceType::Playback;
|
||||
Core::App().mediaDevices().forceRefresh(type);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -555,7 +555,8 @@ void ChooseAudioDeviceBox(
|
||||
return;
|
||||
}
|
||||
const auto weak = Ui::MakeWeak(box);
|
||||
chosen(state->ids.take(value).value_or(kDefaultDeviceId));
|
||||
const auto i = state->ids.find(value);
|
||||
chosen((i != end(state->ids)) ? i->second : kDefaultDeviceId);
|
||||
if (weak) {
|
||||
box->closeBox();
|
||||
}
|
||||
|
Submodule Telegram/lib_webrtc updated: 5a83169788...b78e51ad98
Reference in New Issue
Block a user