Skip to content

Commit

Permalink
[mqtt] build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Apr 2, 2024
1 parent 8eac107 commit ed1b520
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ossia/audio/pipewire_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ class pipewire_audio_protocol : public audio_engine

// Actual execution
ossia::audio_tick_state ts{float_input, float_output, (int)inputs,
(int)outputs, nframes, position->clock.nsec / 1e9};
(int)outputs, nframes, position->clock.nsec * 1e-9};
self.audio_tick(ts);
self.tick_end();
}
Expand Down
5 changes: 2 additions & 3 deletions src/ossia/network/common/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,10 @@ bool match(std::string_view address, const regex_path::path_element& e)

}

namespace ossia
namespace ossia::regex_path
{

std::ostream&
regex_path::operator<<(std::ostream& s, const ossia::regex_path::path_element& p)
std::ostream& operator<<(std::ostream& s, const ossia::regex_path::path_element& p)
{
return s << p.address;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ossia/network/common/path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ struct OSSIA_EXPORT path_element
{
}

OSSIA_EXPORT
friend std::ostream& operator<<(std::ostream& s, const path_element& p);

operator std::string() const { return address; }
};

OSSIA_EXPORT
std::ostream& operator<<(std::ostream& s, const path_element& p);

//! Represents a device in a path, e.g. "foo:"
struct OSSIA_EXPORT device : public path_element
{
Expand Down
6 changes: 4 additions & 2 deletions src/ossia/protocols/mqtt/mqtt_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ void mqtt5_protocol::on_subscribe(const ossia::net::parameter_base& p)
m_subscriptions.visit(&p, [this, &p](auto& res) {
subscribe_state& sub = res.second;

if(std::exchange(sub.state, sub.operating) == sub.operating)
if(std::exchange(sub.state, subscribe_state::operating)
== subscribe_state::operating)
return;

co_spawn(
Expand All @@ -198,7 +199,8 @@ void mqtt5_protocol::on_unsubscribe(const ossia::net::parameter_base& p)
{
m_subscriptions.visit(&p, [this, &p](auto& res) {
subscribe_state& sub = res.second;
if(std::exchange(sub.state, sub.cancelled) == sub.operating)
if(std::exchange(sub.state, subscribe_state::cancelled)
== subscribe_state::operating)
sub.cancellation.emit(boost::asio::cancellation_type::all);
});
}
Expand Down

0 comments on commit ed1b520

Please sign in to comment.