diff options
author | Arun Raghavan <arun@asymptotic.io> | 2023-03-10 07:28:29 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-03-14 14:44:13 +0300 |
commit | 6d248c70ddc0852118231ee144beb2a9f115e700 (patch) | |
tree | 5eb9528a68badfdfe073543bdedc9ffbf9e56702 /mux | |
parent | 62cac113fbeb262c94b54f559e9135576105f386 (diff) |
fmp4: Return a running time in get_next_time()
We were currently returning a value based on the next chunk PTS, but the
expectation in GstAggregator is that we return a running time. This
resulted in spurious wakeups and warnings like:
0:00:01.501685123 1552995 0x55899715c1e0 WARN fmp4mux mux/fmp4/src/fmp4mux/imp.rs:1818:gstfmp4::fmp4mux::imp::FMP4Mux::drain_buffers:<fmp4mux0:sink_1> Don't have a complete GOP for the first stream on timeout in a live pipeline
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1135>
Diffstat (limited to 'mux')
-rw-r--r-- | mux/fmp4/src/fmp4mux/imp.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index c65b83fb0..3a0a11db7 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -2930,7 +2930,24 @@ impl ElementImpl for FMP4Mux { impl AggregatorImpl for FMP4Mux { fn next_time(&self) -> Option<gst::ClockTime> { let state = self.state.lock().unwrap(); - state.chunk_start_pts.opt_add(state.timeout_delay) + let agg = self.obj(); + let segment = agg + .src_pad() + .downcast_ref::<gst_base::AggregatorPad>() + .unwrap() + .segment() + .downcast::<gst::ClockTime>() + .expect("TIME segment"); + + state + .chunk_start_pts + .opt_add(state.timeout_delay) + .and_then(|mut t| { + if !agg.class().as_ref().variant.is_single_stream() { + t += SEGMENT_OFFSET; + } + segment.to_running_time(t) + }) } fn sink_query( |