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.
This commit is contained in:
Sebastian Dröge 2022-08-22 15:20:10 +03:00
parent 2bb071a950
commit 84f6484140

View file

@ -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;