diff options
author | Arun Raghavan <arun@asymptotic.io> | 2023-03-10 07:28:29 +0300 |
---|---|---|
committer | Arun Raghavan <arun@asymptotic.io> | 2023-03-10 18:58:38 +0300 |
commit | 04bb7b4db0fcf84283c07297b1577dd97564a0f9 (patch) | |
tree | 99bf591a97c01d59d7fcc238234dc2c623b016b1 /mux | |
parent | a12a8c566d2e94d037526f3756d2ed27a09f4021 (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/1127>
Diffstat (limited to 'mux')
-rw-r--r-- | mux/fmp4/src/fmp4mux/imp.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 08c39d1be..38e48dd07 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -2928,7 +2928,22 @@ 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() + .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( |