dashdemux2: Remove bogus limitation checks for duration fields

Just like for the seconds field, there are no limitations on the hours and
minutes fields. The specification for xml schema duration fields doesn't forbid
specifying durations with only (huge) minutes or hours values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2951>
This commit is contained in:
Edward Hervey 2022-08-30 11:45:05 +02:00 committed by Edward Hervey
parent 1e269a3c6d
commit 855dabb578
2 changed files with 2 additions and 11 deletions

View file

@ -198,10 +198,6 @@ _mpd_helper_parse_duration (const char *str, guint64 * value)
goto error;
}
hours = read;
if (hours >= 24) {
GST_WARNING ("Hour out of range");
goto error;
}
break;
case 'M':
if (minutes != -1 || seconds != -1) {
@ -209,10 +205,6 @@ _mpd_helper_parse_duration (const char *str, guint64 * value)
goto error;
}
minutes = read;
if (minutes >= 60) {
GST_WARNING ("Minute out of range");
goto error;
}
break;
case 'S':
if (have_ms) {

View file

@ -5732,11 +5732,10 @@ GST_START_TEST (dash_mpdparser_duration)
fail_unless (_mpd_helper_parse_duration ("P35D", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("P-1Y", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("PT-1H", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("PT25H", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("PT25H", &v) == TRUE);
fail_unless (_mpd_helper_parse_duration ("PT-1M", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("PT65M", &v) == FALSE);
fail_unless (_mpd_helper_parse_duration ("PT65M", &v) == TRUE);
fail_unless (_mpd_helper_parse_duration ("PT-1S", &v) == FALSE);
/* seconds are allowed to be larger than 60 */
fail_unless (_mpd_helper_parse_duration ("PT65S", &v) == TRUE);
fail_unless (_mpd_helper_parse_duration ("PT1.1H", &v) == FALSE);