-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't ignore InbandEventStreams at the Representation level #687
Don't ignore InbandEventStreams at the Representation level #687
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise. Thanks!
lib/dash/dash_parser.js
Outdated
var XmlUtils = shaka.util.XmlUtils; | ||
|
||
var adaptationEventStream = XmlUtils.findChild(elem, 'InbandEventStream'); | ||
var representation = XmlUtils.findChild(elem, 'Representation'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works if there is exactly one Representation. You should probably use findChildren instead, and loop through them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, good catch. Will update.
lib/dash/dash_parser.js
Outdated
shaka.dash.DashParser.prototype.eventStreamIsPresent_ = function(elem) { | ||
var XmlUtils = shaka.util.XmlUtils; | ||
|
||
var adaptationEventStream = XmlUtils.findChild(elem, 'InbandEventStream'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could return early here if adaptationEventStream
'<MPD minBufferTime="PT75S">', | ||
' <Period id="1" duration="PT30S">', | ||
' <AdaptationSet mimeType="video/mp4">', | ||
' <Representation bandwidth="1">', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a test case with multiple Representations, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rolled this into a single test because I thought it would be sufficient but I can separate the single Representation case from the multiple Representation case if you'd prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single test is fine. Thanks!
d184ac5
to
1a9b101
Compare
lib/dash/dash_parser.js
Outdated
XmlUtils.findChild(representations[i], 'InbandEventStream'); | ||
|
||
if (representationEventStream) | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could return true there and return false at the end of the function but I was trying to avoid so many return statements so I handled it with one return at the end of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just one nit. I think we should just return true when we find InbandEventStream inside Representation instead of breaking.
1a9b101
to
1527fc6
Compare
If you guys are happy with these changes, can we merge this? |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Testing in progress... |
All tests passed! |
Looks good, thanks! |
Closes #686