Bug 12118 - Fix entry for application/x-srt
Summary: Fix entry for application/x-srt
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-23 09:37 UTC by Osmo Salomaa
Modified: 2007-11-18 13:45 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (1.19 KB, patch)
2007-08-23 09:38 UTC, Osmo Salomaa
Details | Splinter Review
Proposed patch (1.30 KB, patch)
2007-09-01 06:05 UTC, Osmo Salomaa
Details | Splinter Review

Description Osmo Salomaa 2007-08-23 09:37:02 UTC
There's an entry in the freedesktop.org.xml file for application/x-srt.  This is the SubRip subtitle file format, see e.g. http://en.wikipedia.org/wiki/SubRip.

I suggest that the mimetype be changed to "application/x-subrip" and that the comment be changed from the ambiguous "subtitle file" to "SubRip subtitles".  I'd also add a string match for " --> ".
Comment 1 Osmo Salomaa 2007-08-23 09:38:48 UTC
Created attachment 11233 [details] [review]
Proposed patch
Comment 2 Bastien Nocera 2007-08-31 11:09:28 UTC
The patch is broken, as this is clearly wrong:
+      <match type="string" value=" --> " offset="0"/>

There's no " --> " at offset 0 in subrip files.

You're also completely removing the application/x-srt mime-type. It should be an alias of application/x-subrip, otherwise applications that rely on it will break.
Comment 3 Osmo Salomaa 2007-08-31 16:54:01 UTC
(In reply to comment #2)
> The patch is broken, as this is clearly wrong:
> +      <match type="string" value=" --> " offset="0"/>

I didn't quite understand the offset part of the shared mime-info spec. Offset from where? What does byte offset mean for a plain text file of arbitrary character encoding?
Comment 4 Bastien Nocera 2007-08-31 18:04:46 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > The patch is broken, as this is clearly wrong:
> > +      <match type="string" value=" --> " offset="0"/>
> 
> I didn't quite understand the offset part of the shared mime-info spec. Offset
> from where? What does byte offset mean for a plain text file of arbitrary
> character encoding?

It's the offset from the beginning of the file. You probably want something like offset="0:256" to look for that string in the first 256 chars of the file.
Comment 5 Osmo Salomaa 2007-09-01 06:05:14 UTC
Created attachment 11376 [details] [review]
Proposed patch

Added alias application/x-srt. Added nested match for "1" at offset 0 and fixed offset for " --> ".
Comment 6 Bastien Nocera 2007-09-05 03:06:35 UTC
2007-09-04  Bastien Nocera  <hadess@hadess.net>

        * freedesktop.org.xml.in: Fix the subrip mime-type to mention subrip,
        add magic, patch by Osmo Salomaa <otsaloma@cc.hut.fi>
        * tests/*: add a SubRip subtitle test


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.