diff options
author | Antonio Kevo <antoniok@axis.com> | 2023-05-10 17:02:12 +0300 |
---|---|---|
committer | Antonio Kevo <antoniok@axis.com> | 2023-05-10 17:09:25 +0300 |
commit | cf21bfabf253f4d905fe381ad6e50b2c499c525c (patch) | |
tree | 9d2dfa3169c706096e7919d4527bb396273ddd55 /mux | |
parent | 8b2b12e767006bfd3b84443a68f7a843ee526a0b (diff) |
fmp4: Use updated start_pts when checking stream filled
After calculating the earliest pts, the fragment_start_pts and
chunk_start_pts in State are updated. However, when checking if the
stream is filled, the previous start_pts (set to None) is used instead.
This means that chunk_filled and fragment_filled will be false the first
time aggregate() is called, assuming timeout is false, all_eos is false,
and the sinkpad is not EOS. This requires aggregate() having to be
called a second time before the first fragment is sent.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1207>
Diffstat (limited to 'mux')
-rw-r--r-- | mux/fmp4/src/fmp4mux/imp.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 38e48dd0..d96f0199 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -1117,9 +1117,6 @@ impl FMP4Mux { return; } - let fragment_start_pts = state.fragment_start_pts; - let chunk_start_pts = state.chunk_start_pts; - // Calculate the earliest PTS after queueing input if we can now. let mut earliest_pts = None; let mut start_dts = None; @@ -1228,6 +1225,9 @@ impl FMP4Mux { upstream_events.push((stream.sinkpad.clone(), fku)); } + let fragment_start_pts = state.fragment_start_pts; + let chunk_start_pts = state.chunk_start_pts; + // Check if any of the streams are already filled enough for the first chunk/fragment. for stream in &mut state.streams { self.check_stream_filled( |