mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-09-24 13:00:12 +00:00
fallbackswitch: Fix racy manual switching test
The element has a small race condition where it might output two buffers with the same running time during e.g. a manual switch. In practice this is not a problem, so the test takes this race into account. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/195
This commit is contained in:
parent
b423febfbe
commit
385a983e5f
1 changed files with 6 additions and 2 deletions
|
@ -461,7 +461,7 @@ fn test_manual_switch(live: bool) {
|
|||
push_buffer(&pipeline, gst::ClockTime::SECOND);
|
||||
set_time(&pipeline, gst::ClockTime::SECOND + LATENCY);
|
||||
let mut buffer = pull_buffer(&pipeline);
|
||||
// FIXME: Sometimes we get the ZERO buffer from the fallback sink instead
|
||||
// FIXME: Sometimes we first get the ZERO buffer from the fallback sink
|
||||
if buffer.pts() == Some(gst::ClockTime::ZERO) {
|
||||
buffer = pull_buffer(&pipeline);
|
||||
}
|
||||
|
@ -471,7 +471,11 @@ fn test_manual_switch(live: bool) {
|
|||
push_buffer(&pipeline, 2 * gst::ClockTime::SECOND);
|
||||
push_fallback_buffer(&pipeline, 2 * gst::ClockTime::SECOND);
|
||||
set_time(&pipeline, 2 * gst::ClockTime::SECOND + LATENCY);
|
||||
let buffer = pull_buffer(&pipeline);
|
||||
buffer = pull_buffer(&pipeline);
|
||||
// FIXME: Sometimes we first get the 1sec buffer from the main sink
|
||||
if buffer.pts() == Some(gst::ClockTime::SECOND) {
|
||||
buffer = pull_buffer(&pipeline);
|
||||
}
|
||||
assert_buffer!(buffer, Some(2 * gst::ClockTime::SECOND));
|
||||
|
||||
drop(mainsink);
|
||||
|
|
Loading…
Reference in a new issue