Skip to content

Commit

Permalink
Stream sync test flush old buffers when switching to another source
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaballeros committed Aug 12, 2020
1 parent 20f7cd0 commit 9cc8b18
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/check/gst/test_stream_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ GST_START_TEST (interpipe_stream_sync_compensate_ts)
fail_if (buffer_timestamp1 == 0);
gst_sample_unref (outsample);

/* Disconnect interpipesrc and flush old buffers */
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));

/* Change to another video src */
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink2", NULL);

Expand All @@ -114,6 +119,11 @@ GST_START_TEST (interpipe_stream_sync_compensate_ts)
fail_if (buffer_timestamp2 < buffer_timestamp1);
gst_sample_unref (outsample);

/* Disconnect interpipesrc and flush old buffers */
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));

/* Now change to the first video src and pull another buffer */
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink1", NULL);

Expand Down

0 comments on commit 9cc8b18

Please sign in to comment.