Skip to content
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

"Get Supported Capabilities for Audio/Video Type" algorithm should treat null contentType the same as invalid contentType #261

Closed
cpearce opened this issue Jul 4, 2016 · 3 comments

Comments

@cpearce
Copy link

cpearce commented Jul 4, 2016

The "Get Supported Capabilities for Audio/Video Type" algorithm has these steps:

  1. If content type is the empty string, return null.
  2. If content type is an invalid or unrecognized MIME type, continue to the next iteration.

An empty content type string is invalid. Why isn't it treated the same as other invalid or unrecognized MIME types, where we'd skip that content type and continue the next iteration? Why is an empty content type worse than other forms of invalid MIME types?

I propose we merge these two steps into:

  1. If content type is the empty string, or is an invalid or unrecognized MIME type, continue to the next iteration.
@ddorwin
Copy link
Contributor

ddorwin commented Jul 6, 2016

The empty string is universally invalid input, so we can fail so that the author knows to fix the call. Otherwise, this mistake could be masked. It's also an easy check in implementations.

Unrecognized is implementation-specific, and invalid (non-empty) could also be implementation-specific (i.e. invalid codecs for a real container type that is not recognized by the implementation). Thus, we just skip to the next iteration.

Other than one less step, do you see an advantage to continuing instead of returning on the empty string?

@ddorwin ddorwin added this to the V1NonBlocking milestone Jul 8, 2016
@ddorwin
Copy link
Contributor

ddorwin commented Jul 8, 2016

@cpearce, any comments?

@cpearce
Copy link
Author

cpearce commented Jul 10, 2016

OK, I think it's reasonable that null input is universally invalid, whereas other non-null inputs may be implementation specific. I'm fine with closing this.

@ddorwin ddorwin closed this as completed Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants