How to clear the cache of jitterbuffer?

My pipeline includes rtpjitterbuffer, and in some scenarios, I need to extract all the data from the entire pipeline.When I use the following code, the entire video screen will get stuck. What should I do?

if (gst_element_send_event(c->pipeline, gst_event_new_flush_start())) {
  LOG_INFO("flush start");
if (gst_element_send_event(c->pipeline, gst_event_new_flush_stop(TRUE))) {
  LOG_INFO("flush stop");