diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-09-03 14:20:00 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-09-14 19:53:18 +0200 |
commit | c9f60db2d489cda27629e91fe3009e7c90769460 (patch) | |
tree | dae6a710991481023d44c45e70f6b34d758d410f /tests | |
parent | d9c45e918fd70cfbb2dea076c0320f1b69146c3a (diff) | |
download | gstreamer-plugins-bad-c9f60db2d489cda27629e91fe3009e7c90769460.tar.gz |
mpdparser: Don't consider period start times in periods with segment lists either
https://bugzilla.gnome.org/show_bug.cgi?id=754222
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/dash_mpd.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/check/elements/dash_mpd.c b/tests/check/elements/dash_mpd.c index 4a5277586..66b6bd7f2 100644 --- a/tests/check/elements/dash_mpd.c +++ b/tests/check/elements/dash_mpd.c @@ -3715,6 +3715,7 @@ GST_START_TEST (dash_mpdparser_fragments) GstClockTime nextFragmentDuration; GstClockTime nextFragmentTimestamp; GstClockTime nextFragmentTimestampEnd; + GstClockTime periodStartTime; GstClockTime expectedDuration; GstClockTime expectedTimestamp; GstClockTime expectedTimestampEnd; @@ -3754,8 +3755,8 @@ GST_START_TEST (dash_mpdparser_fragments) /* expected duration of the next fragment */ expectedDuration = duration_to_ms (0, 0, 0, 3, 3, 20, 0); - expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 10, 0); - expectedTimestampEnd = duration_to_ms (0, 0, 0, 3, 3, 30, 0); + expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 0, 0); + expectedTimestampEnd = duration_to_ms (0, 0, 0, 3, 3, 20, 0); ret = gst_mpd_client_get_next_fragment (mpdclient, 0, &fragment); assert_equals_int (ret, TRUE); @@ -3766,6 +3767,9 @@ GST_START_TEST (dash_mpdparser_fragments) assert_equals_uint64 (fragment.timestamp, expectedTimestamp * GST_MSECOND); gst_media_fragment_info_clear (&fragment); + periodStartTime = gst_mpd_parser_get_period_start_time (mpdclient); + assert_equals_uint64 (periodStartTime, 10 * GST_SECOND); + nextFragmentDuration = gst_mpd_client_get_next_fragment_duration (mpdclient, activeStream); assert_equals_uint64 (nextFragmentDuration, expectedDuration * GST_MSECOND); @@ -3902,7 +3906,7 @@ GST_START_TEST (dash_mpdparser_inherited_segmentURL) * We expect duration to be 110 */ expectedDuration = duration_to_ms (0, 0, 0, 0, 0, 110, 0); - expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 10, 0); + expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 0, 0); /* the representation contains 2 segments * - one inherited from AdaptationSet (duration 100) @@ -4007,7 +4011,7 @@ GST_START_TEST (dash_mpdparser_segment_list) * We expect it to be limited to period duration. */ expectedDuration = duration_to_ms (0, 0, 0, 3, 3, 20, 0); - expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 10, 0); + expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 0, 0); ret = gst_mpd_client_get_next_fragment (mpdclient, 0, &fragment); assert_equals_int (ret, TRUE); @@ -4039,6 +4043,7 @@ GST_START_TEST (dash_mpdparser_segment_template) GstMediaFragmentInfo fragment; GstClockTime expectedDuration; GstClockTime expectedTimestamp; + GstClockTime periodStartTime; const gchar *xml = "<?xml version=\"1.0\"?>" "<MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\"" @@ -4103,6 +4108,9 @@ GST_START_TEST (dash_mpdparser_segment_template) assert_equals_uint64 (fragment.duration, expectedDuration * GST_MSECOND); assert_equals_uint64 (fragment.timestamp, expectedTimestamp * GST_MSECOND); + periodStartTime = gst_mpd_parser_get_period_start_time (mpdclient); + assert_equals_uint64 (periodStartTime, 10 * GST_SECOND); + gst_media_fragment_info_clear (&fragment); gst_mpd_client_free (mpdclient); @@ -4177,7 +4185,7 @@ GST_START_TEST (dash_mpdparser_segment_timeline) /* expected duration of the next fragment */ expectedDuration = duration_to_ms (0, 0, 0, 0, 0, 2, 0); - expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 13, 0); + expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 3, 0); ret = gst_mpd_client_get_next_fragment (mpdclient, 0, &fragment); assert_equals_int (ret, TRUE); @@ -4209,11 +4217,9 @@ GST_START_TEST (dash_mpdparser_segment_timeline) flow = gst_mpd_client_advance_segment (mpdclient, activeStream, TRUE); assert_equals_int (flow, GST_FLOW_OK); - /* third segment has a small gap after the second ends (t=10) - * We also need to take into consideration period's start (10) - */ + /* third segment has a small gap after the second ends (t=10) */ expectedDuration = duration_to_ms (0, 0, 0, 0, 0, 3, 0); - expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 20, 0); + expectedTimestamp = duration_to_ms (0, 0, 0, 0, 0, 10, 0); /* check third segment */ ret = gst_mpd_client_get_next_fragment (mpdclient, 0, &fragment); |