GNOME Bugzilla – Bug 575157
xdgmime typefinder: make more conservative
Last modified: 2009-03-13 22:56:22 UTC
I'm a bit uncomfortable with the xdg mime typefinder. I would like to change it to make it less likely that we end up with MIME types trumping GStreamer media types in some scenarios. Since the xdgmime typefinder's stated aim is to avoid false positives of non-media formats (for which are typefinding is likely to suck), I think we should not report any audio/video stuff it typefinds to make sure our typefinders are prefered (they're likely to be better *and* return GStreamer *media* types). For all other types, we should take into account the probability reported IMHO, instead of suggesting everything with the same probability. The probabilities xdg reports seem quite conservative at first glance. They should nevertheless be clamped to make sure only strong xdg results trump weak gst typefind results. But maybe this is not an issue at all (media tests ran fine, didn't they?)
Created attachment 130562 [details] [review] proposed patch
I did see some 'failures' with xdgmime when runnning the QA testsuite... but those were for previously failing files (not because of xdgmime obviously) so I didn't raise my voice more than that. +1 from me to commit this in the prerelease
I don't think the prio of xdgmime has anything to do with the probability... if you take a look at the freedesktop.xml mime database you'll notice that the priority is more or less a random value for the <magic> blocks, which only makes sure that, if more than one <magic> block is matching, that the one with the highest priority is chosen. Blacklisting audio/* and video/* sounds good to me though :)
Created attachment 130602 [details] [review] same as before, just without abusing the priority value as typefind probability
Grand so - plz commit.
(In reply to comment #4) > Created an attachment (id=130602) [edit] > same as before, just without abusing the priority value as typefind probability >