tests: Make sure to provide the KEY_UNIT flag always together with the SNAP flags in seeks

SNAP flags alone make no sense and nowadays cause warnings.
This commit is contained in:
Sebastian Dröge 2018-06-18 12:18:07 +03:00
parent 44f0814855
commit be6afc6a90
4 changed files with 32 additions and 22 deletions

View file

@ -756,7 +756,8 @@ GST_START_TEST (testSeekSnapBeforePosition)
{
/* Seek to 1.5s, snap before, it go to 1s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, -1, 3, 0);
}
@ -767,7 +768,8 @@ GST_START_TEST (testSeekSnapAfterPosition)
{
/* Seek to 1.5s with snap after, it should move to 2s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
2000 * GST_MSECOND, -1, 2, 0);
}
@ -778,7 +780,8 @@ GST_START_TEST (testSeekSnapBeforeSamePosition)
{
/* Snap seek without position */
run_seek_position_test (1.0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
2 * GST_MSECOND, -1, 2, SEGMENT_SIZE * 3 + 1);
}
@ -789,7 +792,8 @@ GST_START_TEST (testSeekSnapAfterSamePosition)
{
/* Snap seek without position */
run_seek_position_test (1.0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
3 * GST_MSECOND, -1, 1, SEGMENT_SIZE * 3 + 1);
}
@ -801,8 +805,8 @@ GST_START_TEST (testReverseSeekSnapBeforePosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE, 1000 * GST_MSECOND,
3000 * GST_MSECOND, 2, 0);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, 3000 * GST_MSECOND, 2, 0);
}
GST_END_TEST;
@ -812,8 +816,8 @@ GST_START_TEST (testReverseSeekSnapAfterPosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER, 1000 * GST_MSECOND,
2000 * GST_MSECOND, 1, 0);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
1000 * GST_MSECOND, 2000 * GST_MSECOND, 1, 0);
}
GST_END_TEST;

View file

@ -5812,7 +5812,8 @@ GST_START_TEST (dash_mpdparser_datetime_with_tz_offset)
assert_equals_int (gst_date_time_get_minute (availabilityStartTime), 10);
assert_equals_int (gst_date_time_get_second (availabilityStartTime), 50);
assert_equals_int (gst_date_time_get_microsecond (availabilityStartTime), 0);
assert_equals_float (gst_date_time_get_time_zone_offset (availabilityStartTime), 8.0);
assert_equals_float (gst_date_time_get_time_zone_offset
(availabilityStartTime), 8.0);
availabilityEndTime = mpdclient->mpd_node->availabilityEndTime;
assert_equals_int (gst_date_time_get_year (availabilityEndTime), 2015);
@ -5823,7 +5824,8 @@ GST_START_TEST (dash_mpdparser_datetime_with_tz_offset)
assert_equals_int (gst_date_time_get_second (availabilityEndTime), 50);
assert_equals_int (gst_date_time_get_microsecond (availabilityEndTime),
123456);
assert_equals_float (gst_date_time_get_time_zone_offset (availabilityEndTime), -4.5);
assert_equals_float (gst_date_time_get_time_zone_offset (availabilityEndTime),
-4.5);
gst_mpd_client_free (mpdclient);
}

View file

@ -493,7 +493,8 @@ GST_START_TEST (testSeekSnapBeforePosition)
{
/* Seek to 1.5s, snap before, it go to 1s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, -1, 3);
}
@ -504,7 +505,8 @@ GST_START_TEST (testSeekSnapAfterPosition)
{
/* Seek to 1.5s with snap after, it should move to 2s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
2000 * GST_MSECOND, -1, 2);
}
@ -515,8 +517,8 @@ GST_START_TEST (testReverseSeekSnapBeforePosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE, 1000 * GST_MSECOND,
3000 * GST_MSECOND, 2);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, 3000 * GST_MSECOND, 2);
}
GST_END_TEST;
@ -526,8 +528,8 @@ GST_START_TEST (testReverseSeekSnapAfterPosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER, 1000 * GST_MSECOND,
2000 * GST_MSECOND, 1);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
1000 * GST_MSECOND, 2000 * GST_MSECOND, 1);
}
GST_END_TEST;

View file

@ -313,7 +313,8 @@ GST_START_TEST (testSeekSnapBeforePosition)
{
/* Seek to 1.5s, snap before, it go to 1s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, -1, 3);
}
@ -324,7 +325,8 @@ GST_START_TEST (testSeekSnapAfterPosition)
{
/* Seek to 1.5s with snap after, it should move to 2s */
run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND,
GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER,
GST_SEEK_TYPE_NONE, 0,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
2000 * GST_MSECOND, -1, 2);
}
@ -335,8 +337,8 @@ GST_START_TEST (testReverseSeekSnapBeforePosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE, 1000 * GST_MSECOND,
3000 * GST_MSECOND, 2);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
1000 * GST_MSECOND, 3000 * GST_MSECOND, 2);
}
GST_END_TEST;
@ -346,8 +348,8 @@ GST_START_TEST (testReverseSeekSnapAfterPosition)
{
run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND,
GST_SEEK_TYPE_SET, 2500 * GST_MSECOND,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER, 1000 * GST_MSECOND,
2000 * GST_MSECOND, 1);
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER,
1000 * GST_MSECOND, 2000 * GST_MSECOND, 1);
}
GST_END_TEST;