check: Use new gst_event_new_segment() API

This commit is contained in:
Edward Hervey 2011-06-03 12:19:49 +02:00
parent ac582227c1
commit e367798945

View file

@ -103,6 +103,7 @@ GST_START_TEST (test_seeking)
{ {
const gchar *tmpdir; const gchar *tmpdir;
GstElement *gnomevfssink; GstElement *gnomevfssink;
GstSegment segment;
gchar *tmp_fn; gchar *tmp_fn;
gint fd; gint fd;
@ -145,8 +146,8 @@ GST_START_TEST (test_seeking)
gst_query_unref (seeking_query); gst_query_unref (seeking_query);
#endif #endif
fail_unless (gst_pad_push_event (mysrcpad, gst_segment_init (&segment, GST_FORMAT_BYTES);
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0))); fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_segment (&segment)));
CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 0); CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 0);
@ -163,9 +164,9 @@ GST_START_TEST (test_seeking)
PUSH_BYTES (8800); PUSH_BYTES (8800);
CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 8900); CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 8900);
if (gst_pad_push_event (mysrcpad, gst_segment_init (&segment, GST_FORMAT_BYTES);
gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 8800, -1, segment.start = 8800;
0))) { if (gst_pad_push_event (mysrcpad, gst_event_new_segment (&segment))) {
GST_LOG ("seek ok"); GST_LOG ("seek ok");
/* make sure that that new position is reported immediately */ /* make sure that that new position is reported immediately */
CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 8800); CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 8800);
@ -174,7 +175,7 @@ GST_START_TEST (test_seeking)
PUSH_BYTES (9256); PUSH_BYTES (9256);
CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 18057); CHECK_QUERY_POSITION (gnomevfssink, GST_FORMAT_BYTES, 18057);
} else { } else {
GST_INFO ("seeking not supported for tempfile?!"); GST_WARNING ("seeking not supported for tempfile?!");
} }
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ())); fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));