g_return_if_fail (start % step == 0);
g_return_if_fail (end % step == 0);
- sstart = (guint64) (start / step);
- sstop = (guint64) (end / step);
+ sstart = (guint) (start / step);
+ sstop = (guint) (end / step);
value->data[0].v_uint64 = (sstart << 32) | sstop;
value->data[1].v_int = step;
}
/* check if it extends the range */
if (v == (INT_RANGE_MIN (src2) - 1) * INT_RANGE_STEP (src2)) {
if (dest) {
- guint64 new_min = (INT_RANGE_MIN (src2) - 1) * INT_RANGE_STEP (src2);
- guint64 new_max = INT_RANGE_MAX (src2) * INT_RANGE_STEP (src2);
+ guint64 new_min =
+ (guint) ((INT_RANGE_MIN (src2) - 1) * INT_RANGE_STEP (src2));
+ guint64 new_max = (guint) (INT_RANGE_MAX (src2) * INT_RANGE_STEP (src2));
gst_value_init_and_copy (dest, src2);
dest->data[0].v_uint64 = (new_min << 32) | (new_max);
}
if (v == (INT_RANGE_MAX (src2) + 1) * INT_RANGE_STEP (src2)) {
if (dest) {
- guint64 new_min = INT_RANGE_MIN (src2) * INT_RANGE_STEP (src2);
- guint64 new_max = (INT_RANGE_MAX (src2) + 1) * INT_RANGE_STEP (src2);
+ guint64 new_min = (guint) (INT_RANGE_MIN (src2) * INT_RANGE_STEP (src2));
+ guint64 new_max =
+ (guint) ((INT_RANGE_MAX (src2) + 1) * INT_RANGE_STEP (src2));
gst_value_init_and_copy (dest, src2);
dest->data[0].v_uint64 = (new_min << 32) | (new_max);
if (scalar ==
(INT_RANGE_MIN (range_value) - 1) * INT_RANGE_STEP (range_value)) {
if (dest) {
- guint64 new_min =
- (INT_RANGE_MIN (range_value) - 1) * INT_RANGE_STEP (range_value);
- guint64 new_max =
- INT_RANGE_MAX (range_value) * INT_RANGE_STEP (range_value);
+ guint64 new_min = (guint)
+ ((INT_RANGE_MIN (range_value) -
+ 1) * INT_RANGE_STEP (range_value));
+ guint64 new_max = (guint)
+ (INT_RANGE_MAX (range_value) * INT_RANGE_STEP (range_value));
gst_value_init_and_copy (dest, range_value);
dest->data[0].v_uint64 = (new_min << 32) | (new_max);
} else if (scalar ==
(INT_RANGE_MAX (range_value) + 1) * INT_RANGE_STEP (range_value)) {
if (dest) {
- guint64 new_min =
- INT_RANGE_MIN (range_value) * INT_RANGE_STEP (range_value);
- guint64 new_max =
- (INT_RANGE_MAX (range_value) + 1) * INT_RANGE_STEP (range_value);
+ guint64 new_min = (guint)
+ (INT_RANGE_MIN (range_value) * INT_RANGE_STEP (range_value));
+ guint64 new_max = (guint)
+ ((INT_RANGE_MAX (range_value) +
+ 1) * INT_RANGE_STEP (range_value));
gst_value_init_and_copy (dest, range_value);
dest->data[0].v_uint64 = (new_min << 32) | (new_max);
}
g_value_unset (&dest);
fail_unless (gst_value_intersect (&dest, &range, &range2) == FALSE);
+ gst_value_set_int_range (&range, -7, -6);
+ fail_unless_equals_int (gst_value_get_int_range_min (&range), -7);
+ fail_unless_equals_int (gst_value_get_int_range_max (&range), -6);
+ gst_value_set_int_range (&range, -7, 7);
+ fail_unless_equals_int (gst_value_get_int_range_min (&range), -7);
+ fail_unless_equals_int (gst_value_get_int_range_max (&range), 7);
+
g_value_unset (&start);
g_value_unset (&end);
g_value_unset (&range);