Skip to content

Commit

Permalink
audio の設定の実装を video 側の実装と合わせる
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Oct 23, 2024
1 parent 928b698 commit b2f5a15
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/sora_signaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ void SoraSignaling::DoSendConnect(bool redirect) {

if (!config_.audio) {
m["audio"] = false;
} else if (config_.audio && config_.audio_codec_type.empty() &&
config_.audio_bit_rate == 0) {
m["audio"] = true;
} else {
m["audio"] = boost::json::object();
if (!config_.audio_codec_type.empty()) {
Expand All @@ -346,6 +343,11 @@ void SoraSignaling::DoSendConnect(bool redirect) {
if (!config_.audio_opus_params.is_null()) {
m["audio"].as_object()["opus_params"] = config_.audio_opus_params;
}

// オプションの設定が行われてなければ単に true を設定
if (m["audio"].as_object().empty()) {
m["audio"] = true;
}
}

if (!config_.audio_streaming_language_code.empty()) {
Expand Down Expand Up @@ -1655,8 +1657,9 @@ void SoraSignaling::OnMessage(
dc_->SetOnClose([self = shared_from_this(), code,
reason](boost::system::error_code ec) {
if (code == 1000) {
self->SendOnDisconnect(SoraSignalingErrorCode::CLOSE_SUCCEEDED,
"Succeeded to close DataChannel: reason=" + reason);
self->SendOnDisconnect(
SoraSignalingErrorCode::CLOSE_SUCCEEDED,
"Succeeded to close DataChannel: reason=" + reason);
} else {
self->SendOnDisconnect(
SoraSignalingErrorCode::CLOSE_SUCCEEDED,
Expand Down

0 comments on commit b2f5a15

Please sign in to comment.