mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 21:05:15 +00:00
audioecho: Minor cleanup and move code to the right place
And move rejection of max-delay changes when we're started from the property getter to the setter where it should be. We can always *get* the current value, just not set it.
This commit is contained in:
parent
67edf375f3
commit
3181631bb7
1 changed files with 6 additions and 8 deletions
|
@ -98,9 +98,9 @@ impl AudioEcho {
|
|||
fn new(_transform: &BaseTransform) -> Self {
|
||||
Self {
|
||||
cat: gst::DebugCategory::new(
|
||||
"rsaudiofx",
|
||||
"rsaudioecho",
|
||||
gst::DebugColorFlags::empty(),
|
||||
"Rust audiofx effect",
|
||||
"Rust audioecho effect",
|
||||
),
|
||||
settings: Mutex::new(Default::default()),
|
||||
state: Mutex::new(None),
|
||||
|
@ -180,7 +180,9 @@ impl ObjectImpl<BaseTransform> for AudioEcho {
|
|||
match *prop {
|
||||
Property::UInt64("max-delay", ..) => {
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
settings.max_delay = value.get().unwrap();
|
||||
if self.state.lock().unwrap().is_none() {
|
||||
settings.max_delay = value.get().unwrap();
|
||||
}
|
||||
}
|
||||
Property::UInt64("delay", ..) => {
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
|
@ -204,11 +206,7 @@ impl ObjectImpl<BaseTransform> for AudioEcho {
|
|||
match *prop {
|
||||
Property::UInt64("max-delay", ..) => {
|
||||
let settings = self.settings.lock().unwrap();
|
||||
if self.state.lock().unwrap().is_none() {
|
||||
Ok(settings.max_delay.to_value())
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
Ok(settings.max_delay.to_value())
|
||||
}
|
||||
Property::UInt64("delay", ..) => {
|
||||
let settings = self.settings.lock().unwrap();
|
||||
|
|
Loading…
Reference in a new issue