Skip to content

gstreamer: Use more lenient MIME type parser for canPlayType. - #47641

Merged
jdm merged 1 commit into
servo:mainfrom
jdm:canplay-mime
Aug 30, 2026
Merged

jdm merged 1 commit into
servo:mainfrom
jdm:canplay-mime

Conversation

@jdm

@jdm jdm commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

The tests that now pass were using a MIME type like "audio/mp4;codecs", for which the mime crate returns an error because it expects a = following each MIME type parameter name. The data-url crate's MIME type parser handles this the same way as other browsers; there's a parameter named codecs with an empty value.

Testing: New passing tests.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2026
expected: PRECONDITION_FAILED

[audio/ogg with and without codecs]
[audio/mp4 with and without codecs]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A few of these new failures will be fixed by my forthcoming fix for #46259.

gstreamer-video = { workspace = true }
gstreamer-webrtc = { workspace = true }
log = { workspace = true }
mime = { workspace = true }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We use the mime crate in other places as well. Should we in general start replacing it with data-url?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's #2909

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2026
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 30, 2026
@jdm
jdm enabled auto-merge August 30, 2026 05:12
@jdm
jdm added this pull request to the merge queue Aug 30, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 30, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 30, 2026
@jdm
jdm added this pull request to the merge queue Aug 30, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 30, 2026
Merged via the queue into servo:main with commit eabc6c5 Aug 30, 2026
42 checks passed
@jdm
jdm deleted the canplay-mime branch August 30, 2026 06:51
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 30, 2026
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…47641)

The tests that now pass were using a MIME type like "audio/mp4;codecs",
for which the mime crate returns an error because it expects a =
following each MIME type parameter name. The data-url crate's MIME type
parser handles this the same way as other browsers; there's a parameter
named `codecs` with an empty value.

Testing: New passing tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Psychpsyo pushed a commit to Psychpsyo/servo that referenced this pull request Oct 12, 2026
…47641)

The tests that now pass were using a MIME type like "audio/mp4;codecs",
for which the mime crate returns an error because it expects a =
following each MIME type parameter name. The data-url crate's MIME type
parser handles this the same way as other browsers; there's a parameter
named `codecs` with an empty value.

Testing: New passing tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants