Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Dec 4, 2023
1 parent ed08dcb commit 5c6996c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions libwebrtc/src/audio_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl RtcAudioSource {
[Native];
fn set_audio_options(self: &Self, options: AudioSourceOptions) -> ();
fn audio_options(self: &Self) -> AudioSourceOptions;
fn captured_frames(self: &Self) -> usize;
fn sample_rate(self: &Self) -> u32;
fn num_channels(self: &Self) -> u32;
);
Expand Down Expand Up @@ -80,10 +79,6 @@ pub mod native {
self.handle.audio_options()
}

pub fn captured_frames(&self) -> usize {
self.handle.captured_frames()
}

pub fn sample_rate(&self) -> u32 {
self.handle.sample_rate()
}
Expand Down
4 changes: 2 additions & 2 deletions libwebrtc/src/native/audio_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl NativeAudioSource {
// (We don't want to increase the captured_frames count and no need to buffer)
interval.tick().await;

let mut inner = source.inner.lock().await;
let inner = source.inner.lock().await;
if inner.captured_frames > 0 {
break; // User captured something, stop injecting silence
}
Expand All @@ -89,7 +89,7 @@ impl NativeAudioSource {
&data,
sample_rate,
num_channels,
sample_rate / 100,
sample_rate as usize / 100,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions webrtc-sys/include/livekit/audio_track.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class AudioTrackSource {
void set_audio_options(const AudioSourceOptions& options) const;

void on_captured_frame(rust::Slice<const int16_t> audio_data,
int sample_rate,
size_t number_of_channels,
uint32_t sample_rate,
uint32_t number_of_channels,
size_t number_of_frames) const;

rtc::scoped_refptr<InternalSource> get() const;
Expand Down
4 changes: 2 additions & 2 deletions webrtc-sys/src/audio_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ void AudioTrackSource::set_audio_options(
}

void AudioTrackSource::on_captured_frame(rust::Slice<const int16_t> audio_data,
int sample_rate,
size_t number_of_channels,
uint32_t sample_rate,
uint32_t number_of_channels,
size_t number_of_frames) const {
source_->on_captured_frame(audio_data, sample_rate, number_of_channels,
number_of_frames);
Expand Down

0 comments on commit 5c6996c

Please sign in to comment.