fmp4mux: Crank clock for the first fragment in more tests

Due to how aggregator works, it depends on how buffers are pulled
whether aggregate() is called again or it is waiting for a timeout or EOS:

works:
  - pad 1: 4 buffers, pad 2: 4 buffers
  - aggregate ready: take all 4/4 buffers
  - pad 1: 1 buffers, pad 2: 1 buffer
  - aggregate ready: take all 1/1 buffers

waits:
  - pad 1: 5 buffers, pad 2: 4 buffers
  - aggregate ready: take all 5/4 buffers
  - pad 1: 0 buffers, pad 2: 1 buffer
  - aggregate not ready: waiting for timeout or EOS

Also don't manually set the clock time as that's unnecessary.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/274

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/998>
This commit is contained in:
Sebastian Dröge 2022-12-03 19:56:46 +02:00 committed by GStreamer Marge Bot
parent e6fa7c0b2b
commit 3172bcd095

View file

@ -77,6 +77,9 @@ fn test_buffer_flags_single_stream(cmaf: bool, set_dts: bool, caps: gst::Caps) {
}
}
// Crank the clock: this should bring us to the end of the first fragment
h.crank_single_clock_wait().unwrap();
let header = h.pull().unwrap();
assert_eq!(
header.flags(),
@ -312,6 +315,9 @@ fn test_buffer_flags_multi_stream() {
}
}
// Crank the clock: this should bring us to the end of the first fragment
h1.crank_single_clock_wait().unwrap();
let header = h1.pull().unwrap();
assert_eq!(
header.flags(),
@ -509,8 +515,7 @@ fn test_live_timeout() {
}
}
// Advance time and crank the clock: this should bring us to the end of the first fragment
h1.set_time(5.seconds()).unwrap();
// Crank the clock: this should bring us to the end of the first fragment
h1.crank_single_clock_wait().unwrap();
let header = h1.pull().unwrap();
@ -728,8 +733,7 @@ fn test_gap_events() {
}
}
// Advance time and crank the clock: this should bring us to the end of the first fragment
h1.set_time(5.seconds()).unwrap();
// Crank the clock: this should bring us to the end of the first fragment
h1.crank_single_clock_wait().unwrap();
let header = h1.pull().unwrap();
@ -1019,6 +1023,9 @@ fn test_single_stream_long_gops() {
}
}
// Crank the clock: this should bring us to the end of the first fragment
h.crank_single_clock_wait().unwrap();
let header = h.pull().unwrap();
assert_eq!(
header.flags(),