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:
authorMathieu Duponchelle <mathieu@centricular.com>2022-05-11 02:42:10 +0300
committerSebastian Dröge <slomo@coaxion.net>2022-05-11 09:29:22 +0300
commit943a138d490e1e97435c428208be7f781c9a2c1e (patch)
tree030ff2f0a815fbf4671b7fb7b162c43a62cdf19c /generic/threadshare/src/jitterbuffer
parent05ece5560e3251e0fc988d7a796a378365e98ceb (diff)
ts-jitterbuffer: set jbuf delay when instantiating it
The internal (C) jitterbuffer needs to know about the configured latency when calculating a PTS, as it otherwise may consider that the packet is too late, trigger a resync and cause the element to discard the packet altogether. I could not identify when this was broken, but the net effect was that in the current state, ts-jitterbuffer was discarding up to half of all the incoming packets.
Diffstat (limited to 'generic/threadshare/src/jitterbuffer')
-rw-r--r--generic/threadshare/src/jitterbuffer/imp.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs
index 895df9947..312eb852e 100644
--- a/generic/threadshare/src/jitterbuffer/imp.rs
+++ b/generic/threadshare/src/jitterbuffer/imp.rs
@@ -1074,7 +1074,12 @@ impl TaskImpl for JitterBufferTask {
self.sink_pad_handler.clear();
let jb = self.element.imp();
- *jb.state.lock().unwrap() = State::default();
+
+ let latency = jb.settings.lock().unwrap().latency;
+ let state = State::default();
+
+ state.jbuf.set_delay(latency);
+ *jb.state.lock().unwrap() = state;
gst::log!(CAT, obj: &self.element, "Task started");
Ok(())