Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-07-03 18:44:25 +0300
committerSebastian Dröge <sebastian@centricular.com>2019-07-05 17:05:47 +0300
commit9ac080dc88133a0f4e73d45ff8559b3b518e0e43 (patch)
treec0c59b3f17c520b6869ad71fdddae84631c6a9ed
parentd43289b6b18d0be9a021125794c89793567ae557 (diff)
togglerecord: Minor code cleanup
-rw-r--r--gst-plugin-togglerecord/src/togglerecord.rs33
1 files changed, 15 insertions, 18 deletions
diff --git a/gst-plugin-togglerecord/src/togglerecord.rs b/gst-plugin-togglerecord/src/togglerecord.rs
index 5d8d4f185..824356aea 100644
--- a/gst-plugin-togglerecord/src/togglerecord.rs
+++ b/gst-plugin-togglerecord/src/togglerecord.rs
@@ -996,13 +996,10 @@ impl ToggleRecord {
gst_log!(self.cat, obj: pad, "Handling event {:?}", event);
- let mut forward = true;
- match event.view() {
- EventView::Seek(..) => {
- forward = false;
- }
- _ => (),
- }
+ let forward = match event.view() {
+ EventView::Seek(..) => false,
+ _ => true,
+ };
let rec_state = self.state.lock();
let running_time_offset = rec_state.running_time_offset.unwrap_or(0) as i64;
@@ -1058,7 +1055,7 @@ impl ToggleRecord {
.collect::<Vec<_>>(),
);
gst_log!(self.cat, obj: pad, "Returning {:?}", q.get_mut_query());
- return true;
+ true
}
QueryView::Seeking(ref mut q) => {
// Seeking is not possible here
@@ -1070,7 +1067,7 @@ impl ToggleRecord {
);
gst_log!(self.cat, obj: pad, "Returning {:?}", q.get_mut_query());
- return true;
+ true
}
// Position and duration is always the current recording position
QueryView::Position(ref mut q) => {
@@ -1085,9 +1082,9 @@ impl ToggleRecord {
state.current_running_time - rec_state.last_recording_start;
}
q.set(recording_duration);
- return true;
+ true
} else {
- return false;
+ false
}
}
QueryView::Duration(ref mut q) => {
@@ -1102,16 +1099,16 @@ impl ToggleRecord {
state.current_running_time - rec_state.last_recording_start;
}
q.set(recording_duration);
- return true;
+ true
} else {
- return false;
+ false
}
}
- _ => (),
- };
-
- gst_log!(self.cat, obj: pad, "Forwarding query {:?}", query);
- stream.sinkpad.peer_query(query)
+ _ => {
+ gst_log!(self.cat, obj: pad, "Forwarding query {:?}", query);
+ stream.sinkpad.peer_query(query)
+ }
+ }
}
fn iterate_internal_links(