[MPlayer-dev-eng] MPlayer-dev-eng Digest, Vol 116, Issue 3
Clément Bœsch
ubitux at gmail.com
Tue Aug 7 22:01:16 CEST 2012
On Fri, Aug 03, 2012 at 08:57:11AM -0300, Federico Kereki wrote:
> 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.
>
Well it's certainly possible there are some.
> As to *color=#ff0000*, I got the latest MPlayer version and it was still
> being rejected, as the pictures I sent show.
>
Yeah I mean someone already posted a more advanced patch from Szokovacs
Robert:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2012-April/070237.html
(which IIRC was already superseding another)
Unfortunately I never had time to review it properly or fix what was
eventually missing.
I'll give it a try soon© but I can't promise anything. If any other dev
feel like one patch should be applied as-is, go for it.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120807/a7f0b5b8/attachment.asc>
More information about the MPlayer-dev-eng
mailing list