[FFmpeg-devel] [PATCH 2/2] movtextenc.c: Support for Bold, Italic and Underlined styles

Philip Langdale philipl at overt.org
Tue Jun 23 16:36:54 CEST 2015


On Tue, 23 Jun 2015 11:14:36 +0530
Niklesh Lalwani <niklesh.lalwani at iitb.ac.in> wrote:

> On 6/23/15, Philip Langdale <philipl at overt.org> wrote:
> > I got a bunch of warnings when I compiled it. Please fix.
> >
> > Thanks.
> >
> > ----------------------------------------------------------
> >
> > CC libavcodec/movtextenc.o
> > libavcodec/movtextenc.c: In function ‘mov_text_style_cb’:
> > libavcodec/movtextenc.c:124:17: warning: ‘return’ with a value, in
> > function returning void return AVERROR(ENOMEM);
> > ^
> > libavcodec/movtextenc.c:138:21: warning: ‘return’ with a value, in
> > function returning void return AVERROR(ENOMEM);
> > ^
> > libavcodec/movtextenc.c:167:13: warning: ‘return’ with a value, in
> > function returning void return AVERROR(ENOMEM);
> 
> The function mov_text_style_cb() is a void function, I'll make it int
> funciton to return a value.

The function signature is fixed by the ASS callback struct - you can't
change it. That means that it has to stay void. I guess you'll need to
find a way to handle the allocation failures internally. I would suggest
that means dropping styles if you can't allocate for them. Which is
fine. If the user gets into this situation, they can't expect things
to magically work.
> 
> As for these warnings, we discussed that they were fine as long as I
> am keeping check of alignment and placement into the buffer properly.
> Defining all these variables as char* would make the code lengthier
> and less clean. What do you suggest?

Fair. Keep it as is for now.

Thanks,

--phil


More information about the ffmpeg-devel mailing list