Commit 805ff11f authored by Guillaume Desmottes's avatar Guillaume Desmottes

dlna_src_parse_npt_range: stop time is optional

The MCVT tool server doesn't report any.
parent abae12f4
......@@ -151,7 +151,8 @@ dlna_src_parse_npt_range (GstDlnaSrc * dlna_src, const gchar * field_str,
if (!dlna_src_npt_to_nanos (dlna_src, *start_str, start))
goto fail;
/* Read stop value */
/* Read stop value, if any */
if (g_ascii_isdigit (cursor[0])) {
ret_code = sscanf (cursor, "%31[^/ ]%*s", tmp2);
if (ret_code == -1)
goto fail;
......@@ -161,6 +162,7 @@ dlna_src_parse_npt_range (GstDlnaSrc * dlna_src, const gchar * field_str,
*stop_str = g_strdup (tmp2);
if (!dlna_src_npt_to_nanos (dlna_src, *stop_str, stop))
goto fail;
}
/* Do we have the total length? */
if (cursor[0] == '/') {
......
......@@ -36,6 +36,8 @@ test_parse_ntp_range (void)
"335.1", "336.1", "40445.4", 335099985920, 336099999744, 40445400842240);
do_test_parse_ntp_range ("availableSeekRange.dlna.org: 0 npt=0:00:00.000-0:00:48.716 bytes=0-5219255 cleartextbytes=0-5219255",
"0:00:00.000", "0:00:48.716", NULL, 0, 48716001280, 0);
do_test_parse_ntp_range ("npt=10.0-/* bytes=24409920-198755327/198755328",
"10.0", NULL, "*", 10000000000, 0, 0);
}
int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment