diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-12-03 20:56:46 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2022-12-05 03:47:51 +0300 |
commit | a7c75f8066cca47d9c0d5626f0a89ef731378239 (patch) | |
tree | 3b1f7e73679ffa2966a3662b7fd918ba5aabbed4 | |
parent | 08799d242c888891ce36e472e9b1f4f1617f1a16 (diff) |
fmp4mux: Crank clock for the first fragment in more testsgstreamer-1.21.3
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/999>
-rw-r--r-- | mux/fmp4/tests/tests.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mux/fmp4/tests/tests.rs b/mux/fmp4/tests/tests.rs index 5e10754a..bb1b794d 100644 --- a/mux/fmp4/tests/tests.rs +++ b/mux/fmp4/tests/tests.rs @@ -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(), |