diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-08-22 15:20:10 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-08-22 15:20:10 +0300 |
commit | 84f6484140098826b3f074d806e0eb052198df43 (patch) | |
tree | 8bb12fae5aab548863ad6493c2ac04a6220ef398 | |
parent | 2bb071a950c1b78b8e324c916294251ca822fb37 (diff) |
fmp4mux: Consider invalid running times as zero and before anything else
The code tried to do this before but didn't consider the case where the
first pad has a valid running time, in which case the buffer with the
invalid running time would never be dequeued and the muxer would never
output anything.
-rw-r--r-- | generic/fmp4/src/fmp4mux/imp.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/fmp4/src/fmp4mux/imp.rs b/generic/fmp4/src/fmp4mux/imp.rs index aa74ab03a..7d9aa7302 100644 --- a/generic/fmp4/src/fmp4mux/imp.rs +++ b/generic/fmp4/src/fmp4mux/imp.rs @@ -225,7 +225,12 @@ impl FMP4Mux { let running_time = match segment.to_running_time(buffer.dts_or_pts()) { None => { gst::trace!(CAT, obj: &stream.sinkpad, "Stream has no valid running time"); - if earliest_stream.is_none() { + if earliest_stream + .as_ref() + .map_or(true, |(_, _, earliest_running_time)| { + *earliest_running_time > gst::ClockTime::ZERO + }) + { earliest_stream = Some((idx, stream, gst::ClockTime::ZERO)); } continue; |