Open Bug 1083728 Opened 10 years ago Updated 2 years ago

Should not decide stuff based on the extension if the extension is known to map to two different kinds of things.

Categories

(Firefox :: File Handling, defect)

defect

Tracking

()

People

(Reporter: m_kato, Unassigned)

References

Details

+++ This bug was initially created as a clone of Bug #1071433 +++ from Bug 1071433 comment #20 > But more generally, this system sounds kind of broken: we shouldn't be deciding > stuff based on the extension if the extension is known to map to two different > kinds of things. So we can do the patch here as a quick fix, but presumably we > need a separate bug for a longer-term and more correct fix in whatever code > actually cares about the difference and can tell the two types of files apart.
Why is this a core audio/video bug? Seems like it would be a bug in whatever app is making these assumptions...
Flags: needinfo?(m_kato)
(In reply to Boris Zbarsky [:bz] from comment #1) > Why is this a core audio/video bug? Seems like it would be a bug in > whatever app is making these assumptions... Oh, sorry. I should change to docshell. DeviceStorage seems to use nsIMimeService, so it doesn't sniffer content of file.
Flags: needinfo?(m_kato)
Component: Video/Audio → Document Navigation
This has nothing to do with docshell either! > DeviceStorage seems to use nsIMimeService The MIME service will do what the OS tells it, then fall back on extensions. If consumers want some other behavior, they should not use the MIME service, or should fix the per-platform implementation to do what they want.
Component: Document Navigation → File Handling
Device storage is essentially using file extension to determine file type. It doesn't persist the mime type anywhere. The filesystem doesn't support that (unless it were to store the information in some aux file, or database). Device Storage definitely doesn't look inside the file.
The point is that the device storage consumer in this case has two different file types both using the same extension, and it wants to treat them as one particular MIME type. So either we need to fix that consumer to actually do the things it wants itself, or we need to fix devidestorage to provide what it needs, or something.
Currently, the consuming app, which is the one that knows how to parse the content, should ignore files which don't have the correct metadata. With some types, like ogg it's considere audio if it has no video track, but a video player could still play such a file, just with no video shown. We could duplicate all of the metadata parsing in device storage so device storage can figure out the type of the file
Product: Core → Firefox
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.