Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pssh boxes #24

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

Merged
juliancooper merged 6 commits into master from pssh-boxes
Mar 3, 2016
Merged

Pssh boxes #24

juliancooper merged 6 commits into master from pssh-boxes
Mar 3, 2016

Conversation

@juliancooper
Copy link
Contributor

@juliancooper juliancooper commented Mar 3, 2016

  • Added support for including <cenc:pssh> elements within Playready and Widevine ContentProtection schemes

mpd/mpd.go Outdated
// !!! Note: this function will accept any wvHeader value !!!
func (as *AdaptationSet) AddNewContentProtectionSchemeWidevine(wvHeaders ...[]byte) (*WidevineContentProtection, error) {
if len(wvHeaders) > 1 {
panic("AddNewContentProtectionSchemeWidevine accepts at most 1 wvHeader slice")
Copy link
Contributor

@brycefisher brycefisher Mar 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, panic? Why not just return this as error?

Copy link
Contributor

@brycefisher brycefisher Mar 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why call the variable wvHeaders if it can only hold 1 byte slice? The comment above even calls it wvHeader. Let's consider using that name or changing the function signature

Copy link
Contributor Author

@juliancooper juliancooper Mar 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backwards compatibility. It makes wvHeaders optional, if more than 1 argument is passed to the function it's more of a syntax error, rather than something that can/should be handled by the applicaiton.

cp.XMLNS = Strptr(CENC_XMLNS)
prSystemID, err := hex.DecodeString(CONTENT_PROTECTION_PLAYREADY_SCHEME_HEX)
if err != nil {
panic(err.Error())
Copy link
Contributor

@brycefisher brycefisher Mar 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I'm okay with this in this situation due to the author's vehement defense of this panic and the peculiarity of this code path.

However, as a general rule of thumb, avoid panics. I probably would not accept this code as is in a future PR without a more compelling special case explanation of why a consumer of this library would want a panic in the critical path.

Copy link
Contributor Author

@juliancooper juliancooper Mar 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Objection noted.

Copy link
Contributor

LGTM

juliancooper added a commit that referenced this pull request Mar 3, 2016
@juliancooper juliancooper merged commit d12b37d into master Mar 3, 2016
@brycefisher brycefisher deleted the pssh-boxes branch March 3, 2016 22:49
@juliancooper juliancooper restored the pssh-boxes branch March 3, 2016 23:44
Copy link

Coverage Status

Coverage decreased (-9.6%) to 73.563% when pulling 4bbd135 on pssh-boxes into 2fe5395 on master.

@brycefisher brycefisher deleted the pssh-boxes branch March 4, 2016 23:20
Copy link

Coverage Status

Coverage decreased (-9.6%) to 73.563% when pulling 4bbd135 on pssh-boxes into 2fe5395 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /