Skip to content

Commit

Permalink
drop this
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog committed Oct 27, 2024
1 parent 7ed24cd commit 322acd8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: CI

on:
pull_request:
branches: [master]
branches: [libdd-part-1]
types: [opened, synchronize, reopened]
push:
branches: [master]
branches: [libdd-part-1]
workflow_dispatch:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ name: CI Docker

on:
pull_request:
branches: [master]
branches: [libdd-part-1]
types: [opened, synchronize, reopened]
push:
branches: [master]
branches: [libdd-part-1]
workflow_dispatch:

concurrency:
Expand Down
6 changes: 3 additions & 3 deletions src/display_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace display_device {
[[nodiscard]] bool
capture() override {
return context_scheduler.execute([](auto &audio_context) {
// Explicitly releasing the context first in case it was not release yet
// Explicitly releasing the context first in case it was not release yet so that it can be potentially cleaned up.
audio_context = boost::none;
audio_context = audio_context_t {};

Expand All @@ -63,7 +63,7 @@ namespace display_device {

[[nodiscard]] bool
isCaptured() const override {
return context_scheduler.execute([](auto &audio_context) {
return context_scheduler.execute([](const auto &audio_context) {
if (audio_context) {
// In case we still have context we need to check whether it was released or not.
// If it was released we can pretend that we no longer have it as it will be immediately cleaned up in `capture` method before we acquire new context.
Expand Down Expand Up @@ -117,7 +117,7 @@ namespace display_device {
int retry_counter { 15 };
};

mutable RetryScheduler<boost::optional<audio_context_t>> context_scheduler { std::make_unique<boost::optional<audio_context_t>>(boost::none) };
RetryScheduler<boost::optional<audio_context_t>> context_scheduler { std::make_unique<boost::optional<audio_context_t>>(boost::none) };
};

/**
Expand Down
9 changes: 5 additions & 4 deletions src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ namespace nvhttp {

if (rtsp_stream::session_count() == 0) {
// We want to prepare display only if there are no active sessions at
// the moment. This should to be done before probing encoders as it could
// the moment. This should be done before probing encoders as it could
// change the active displays.
display_device::configure_display(config::video, *launch_session);

Expand Down Expand Up @@ -945,14 +945,15 @@ namespace nvhttp {
// Newer Moonlight clients send localAudioPlayMode on /resume too,
// so we should use it if it's present in the args and there are
// no active sessions we could be interfering with.
if (rtsp_stream::session_count() == 0 && args.find("localAudioPlayMode"s) != std::end(args)) {
const bool no_active_sessions { rtsp_stream::session_count() == 0 };
if (no_active_sessions && args.find("localAudioPlayMode"s) != std::end(args)) {
host_audio = util::from_view(get_arg(args, "localAudioPlayMode"));
}
const auto launch_session = make_launch_session(host_audio, args);

if (rtsp_stream::session_count() == 0) {
if (no_active_sessions) {
// We want to prepare display only if there are no active sessions at
// the moment. This should to be done before probing encoders as it could
// the moment. This should be done before probing encoders as it could
// change the active displays.
display_device::configure_display(config::video, *launch_session);

Expand Down
4 changes: 2 additions & 2 deletions src/platform/linux/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ namespace platf {

bool
is_sink_available(const std::string &sink) override {
// TODO: implement
return false;
BOOST_LOG(warning) << "audio_control_t::is_sink_available() unimplemented: "sv << sink;
return true;
}

int
Expand Down
2 changes: 1 addition & 1 deletion src/platform/macos/microphone.mm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
bool
is_sink_available(const std::string &sink) override {
BOOST_LOG(warning) << "audio_control_t::is_sink_available() unimplemented: "sv << sink;
return false;
return true;
}

std::optional<sink_t>
Expand Down

0 comments on commit 322acd8

Please sign in to comment.