togglerecord: provide details when RT assertion fails

We hit this assertion once during our tests but it's unclear why.
This change will hopefully help us understanding what's going on next
time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1809>
This commit is contained in:
Guillaume Desmottes 2024-09-25 10:52:00 +02:00 committed by GStreamer Marge Bot
parent 36304a7d36
commit 2fc8d6a27d

View file

@ -1010,9 +1010,15 @@ impl ToggleRecord {
// We're properly started, must have a start position and
// be actually after that start position
assert!(current_running_time
if !current_running_time
.opt_ge(rec_state.last_recording_start)
.unwrap_or(false));
.unwrap_or(false)
{
panic!(
"current RT ({current_running_time:?}) < last_recording_start ({:?})",
rec_state.last_recording_start
);
}
gst::log!(CAT, obj = pad, "Passing buffer (recording)");
Ok(HandleResult::Pass(data))
}