[FFmpeg-devel] [PATCH] lavfi: add avolume filter

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Nov 5 11:16:17 CET 2011


On Sat, Nov 05, 2011 at 02:12:31AM +0100, Stefano Sabatini wrote:
> On date Friday 2011-11-04 17:15:25 +0100, Reimar Döffinger encoded:
> > On Thu, Nov 03, 2011 at 10:14:30PM +0100, Reimar Döffinger wrote:
> > > On Thu, Nov 03, 2011 at 01:24:14AM +0100, Stefano Sabatini wrote:
> > > > +    .inputs  = (AVFilterPad[])  {{ .name           = "default",
> > > > +                                   .type           = AVMEDIA_TYPE_AUDIO,
> > > > +                                   .filter_samples = filter_samples,
> > > > +                                   .min_perms      = AV_PERM_READ, AV_PERM_WRITE},
> > > > +                                 { .name = NULL}},
> > > 
> > > Sorry for coming in with something unrelated and that probably was
> > > discussed already a long time ago, but why are these not
> > > "const AVFilterPad[]"?
> 
> Short answer: it was always like this. I guess the idea of having it
> non-const was to be able to change pad type dynamically (e.g. setting
> audio/video in a generic showinfo filter, and I'm not sure if this is
> really doable) or maybe it was just a typo.

You could still replace the .inputs pointer, which also would avoid
having to cast the const away (because .inputs is a const pointer).

> > Let me clarify that it looks to me that this causes _a lot_ of data
> > to be in .data that should really be in .rodata (for performance,
> > security and other reasons).
> 
> I think it should be possible to change the constness with no other
> functional changes (but better to ifdef the change until the next
> major bump, for avoiding to break compatibility).

How could this break compatibility with anything if there's no
reason within libavfilter for it?
Do you think there are applications that cast away the const
from .inputs and mess with the filter pad internals?


More information about the ffmpeg-devel mailing list