summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorin Apostol <florin.apostol@oregan.net>2015-06-15 16:59:33 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-06-24 12:22:33 +0200
commitd02f9d30af0191835f24a514360bd9045f7feeb8 (patch)
tree3cf32320aa2e1a6e8d47eef763298909747a9b07
parent4b40c41035bcbfc64b6df861fc414ae488eabe84 (diff)
tests: dashdemux: corrected return type for duration_to_ms function
The duration_to_ms function converts a time specified by year, month, day, hour, minute, second, millisecond to a millisecond value. Because all the arguments are positive numbers, the result must also be positive. This patch changes the returned value from a gint64 to a guint64 type.
-rw-r--r--tests/check/elements/dash_mpd.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/check/elements/dash_mpd.c b/tests/check/elements/dash_mpd.c
index ebb4e998b..2b5015898 100644
--- a/tests/check/elements/dash_mpd.c
+++ b/tests/check/elements/dash_mpd.c
@@ -32,15 +32,15 @@ GST_DEBUG_CATEGORY (gst_dash_demux_debug);
* This function must use the same conversion algorithm implemented in
* gst_mpdparser_get_xml_prop_duration from gstmpdparser.c file.
*/
-static gint64
+static guint64
duration_to_ms (guint year, guint month, guint day, guint hour, guint minute,
guint second, guint millisecond)
{
- gint64 days = (gint64) year * 365 + month * 30 + day;
- gint64 hours = days * 24 + hour;
- gint64 minutes = hours * 60 + minute;
- gint64 seconds = minutes * 60 + second;
- gint64 ms = seconds * 1000 + millisecond;
+ guint64 days = (guint64) year * 365 + (guint64) month * 30 + day;
+ guint64 hours = days * 24 + hour;
+ guint64 minutes = hours * 60 + minute;
+ guint64 seconds = minutes * 60 + second;
+ guint64 ms = seconds * 1000 + millisecond;
return ms;
}
@@ -130,25 +130,25 @@ GST_START_TEST (dash_mpdparser_mpd)
assert_equals_int (gst_date_time_get_second (availabilityEndTime), 50);
assert_equals_int64 (mpdclient->mpd_node->mediaPresentationDuration,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->minimumUpdatePeriod,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->minBufferTime,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->timeShiftBufferDepth,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->suggestedPresentationDelay,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->maxSegmentDuration,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (mpdclient->mpd_node->maxSubsegmentDuration,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
gst_mpd_client_free (mpdclient);
}
@@ -299,9 +299,9 @@ GST_START_TEST (dash_mpdparser_metrics_range)
assert_equals_pointer (metricsNode->metrics, NULL);
metricsRangeNode = (GstMetricsRangeNode *) metricsNode->MetricsRanges->data;
assert_equals_int64 (metricsRangeNode->starttime,
- duration_to_ms (0, 1, 2, 12, 10, 20, 500));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 500));
assert_equals_int64 (metricsRangeNode->duration,
- duration_to_ms (0, 1, 2, 12, 10, 20, 123));
+ (gint64) duration_to_ms (0, 1, 2, 12, 10, 20, 123));
gst_mpd_client_free (mpdclient);
}