[FFmpeg-devel] [PATCH 1/3] lavf/subtitles: add some SMIL helpers.

Clément Bœsch ubitux at gmail.com
Fri Jun 22 22:30:04 CEST 2012


On Wed, Jun 20, 2012 at 09:47:29PM +0200, Nicolas George wrote:
> Le decadi 30 prairial, an CCXX, Clément Bœsch a écrit :
> > +const char *ff_smil_get_attr_ptr(const char *s, const char *attr)
> > +{
> > +    const int len = strlen(attr);
> > +
> > +    while (*s) {
> > +        while (*s && !isspace(*s))
> > +            s++;
> > +        while (isspace(*s))
> > +            s++;
> > +        if (!av_strncasecmp(s, attr, len) && s[len] == '=')
> > +            return s + len + 1 + (s[len + 1] == '"');
> > +    }
> > +    return NULL;
> > +}
> 
> If it is anything like HTML, it could still be fooled by something like
> <node args="video=42; audio=1729">
> I think.
> 

Fixed. Thought it still not perfect (it won't work if you escape the '"'
for instance). But for now I believe it's enough. You'll see the fix with
the new patchset incoming.

[...]

-- 
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://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120622/3f7ca232/attachment.asc>


More information about the ffmpeg-devel mailing list