Closed miyukki closed 6 years ago
Thanks for the PR! I'll take a look today.
Hey @miyukki - sorry it's taken us a while to look at this!
Overall it looks good, but I noticed a few things:
Could we have some error test cases too please? There are some good examples at http://www.datypic.com/sc/xsd/t-xsd_duration.html
The above link also has valid cases for when this starts with things other than PT, which will currently be rejected by your parsing code
We also need test cases for when the field is an integer/float.
I think we probably want to guard against negative durations.
Thanks your review, and I saw the good examples about xsd:duration
.
I changed the parsing code, but I got an issue about duration.
xsd:duration
can be represent the duration with Years and Months, but it couldn't convert to golang time.Duration
because Years and Months are not fixed length of days.
So I calculate the duration with beginning of unix time.
Please let me know if you have any specifications about it.
@miyukki Good point - I can't find anything in the spec about this, so I guess we should just reject durations that contain Years/Months
@thomshutt Sorry, it took so long. I fixed PR. Please review.
Thanks @miyukki, looks great!
Refer to #23
go-dash output the MPD with PT duration, but could not parse its notation. This PR resolve an above issue. However, It might be including the mistake due to I can not read the full specification of MPEG-DASH.