Skip to content

Commit 328419a

Browse files
scoped lock
1 parent f0c6321 commit 328419a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/capture_source.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ CaptureSource::fromOwned(const proto::OwnedCaptureSource &owned) {
114114
if (info.has_codec()) {
115115
source->codec_ = static_cast<VideoCodec>(info.codec());
116116
}
117-
source->source_publish_options_ = fromProto(info.publish_options());
117+
source->source_publish_options_ = fromProto(info.recommended_publish_options());
118118
source->video_source_ = std::shared_ptr<VideoSource>(new VideoSource(
119119
FfiHandle(static_cast<uintptr_t>(info.video_source().handle().id())),
120120
source->width_, source->height_));
@@ -135,7 +135,7 @@ CaptureSource::fromOwned(const proto::OwnedCaptureSource &owned) {
135135
resultFromEvent(event.capture_source_event());
136136
FinishedCallback callback;
137137
{
138-
std::lock_guard<std::mutex> lock(raw->callback_mutex_);
138+
const std::scoped_lock lock(raw->callback_mutex_);
139139
callback = raw->on_finished_;
140140
}
141141
if (callback) {
@@ -177,7 +177,7 @@ CaptureSource::~CaptureSource() {
177177
}
178178

179179
void CaptureSource::setOnFinishedCallback(FinishedCallback callback) {
180-
std::lock_guard<std::mutex> lock(callback_mutex_);
180+
const std::scoped_lock lock(callback_mutex_);
181181
on_finished_ = std::move(callback);
182182
}
183183

0 commit comments

Comments
 (0)