Skip to content

Commit

Permalink
chore: Impl send and sync for sink and source
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Nov 14, 2023
1 parent c48ab15 commit 27dd9a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/audio/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pub struct Source {
pub muted: bool,
}

unsafe impl Send for Source {}
unsafe impl Sync for Source {}

impl Append for Source {
fn append_by_ref(&self, iter: &mut arg::IterAppend) {
iter.append_struct(|i| {
Expand Down Expand Up @@ -96,6 +99,9 @@ pub struct Sink {
pub muted: bool,
}

unsafe impl Send for Sink {}
unsafe impl Sync for Sink {}

impl Append for Sink {
fn append_by_ref(&self, iter: &mut arg::IterAppend) {
iter.append_struct(|i| {
Expand Down Expand Up @@ -307,7 +313,7 @@ impl From<&SourceOutputInfo<'_>> for OutputStream {
.proplist
.get_str("application.name")
.unwrap_or_default();
let sink_index = value.source;
let source_index = value.source;
let index = value.index;
let channels = value.channel_map.len() as u16;
let mut volume = vec![0; channels as usize];
Expand All @@ -319,7 +325,7 @@ impl From<&SourceOutputInfo<'_>> for OutputStream {
index,
name,
application_name,
source_index: sink_index,
source_index,
channels,
volume,
muted,
Expand Down

0 comments on commit 27dd9a2

Please sign in to comment.