[MPlayer-dev-eng] MPlayer-dev-eng Digest, Vol 116, Issue 3

Federico Kereki fkereki at gmail.com
Fri Aug 3 13:57:11 CEST 2012


Hi! Please see below.

---------- Forwarded message ----------

> From: "Clément Bœsch" <ubitux at gmail.com>
> To: mplayer-dev-eng at mplayerhq.hu
> Cc:
> Date: Thu, 2 Aug 2012 14:02:08 +0200
> Subject: Re: [MPlayer-dev-eng] A patch for subtitle colors with missing
> quotation marks
> On Thu, Aug 02, 2012 at 08:01:13AM -0300, Federico Kereki wrote:
> > Hi!
> >
> > I've come across many subtitles files with constructs such as
> >
> > 1
> > 00:00:04,669 --> 00:00:08,669
> > <font color=#00ff00>The Closer 7x19</font>
> > <font color=#00ffff>Last Rites</font>
> > Original Air Date on July 30, 2012
> >
> > where the font color is given in hex notation, but without the required
> > enclosing quotation marks. This isn't allowed, and the viewer gets
> > something like:
> >
> > [image: Inline image 1]
> >
> > This patch allows for these <font> definitions, and now rather shows:
> >
> > [image: Inline image 2]
> >
> > I also refactored a "while(...)" loop, substituting a "for(...)" loop
> > instead.
> >
> > Best regards,
> > Federico Kereki
> >
> >
> >
> > --- subassconvert.original      2012-08-01 22:05:37.609711324 -0300
> > +++ subassconvert.c     2012-08-01 22:08:23.621333241 -0300
> > @@ -194,9 +194,8 @@
> >              int has_valid_attr = 0;
> >
> >              *tag = tag[-1]; // keep values from previous tag
> > -            line += 6;
> >
> > -            while (*line && *line != '>') {
> > +            for (line += 6; *line && *line != '>'; line++) {
> >                  if (strncmp(line, "size=\"", 6) == 0) {
> >                      line += 6;
> >                      tag->size = strtol(line, &line, 10);
> > @@ -204,6 +203,19 @@
> >                          break;
> >                      append_text(&new_line, "{\\fs%d}", tag->size);
> >                      has_valid_attr = 1;
> > +
> > +                } else if (strncmp(line, "color=#", 7) == 0) {
>
> What if "color=yellow", will that work?
>
> I think you are the 3rd guy to propose a patch for this... Wasn't the last
> one approved?
>
> It might be interesting to replace this code with the FFmpeg API which
> might handle that in a better way.
>


Hi!

I didn't patch the code to accept constructs such as *color=yellow* (i.e.,
without any quotation symbols) because I never found such cases.

As to *color=#ff0000*, I got the latest MPlayer version and it was still
being rejected, as the pictures I sent show.

Best regards,
F.Kereki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fontcolor.before2.png
Type: image/png
Size: 24440 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120803/5dff8afe/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fontcolor.after2.png
Type: image/png
Size: 20675 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120803/5dff8afe/attachment-0003.png>


More information about the MPlayer-dev-eng mailing list