On 12/18/2012 01:50 PM, Alex Converse wrote:
> +    if (!strcmp(s->length, "-1"))
> +        s->scaled_length = AV_NOPTS_VALUE;
> +    else
> +       if ((err = av_parse_time(&s->scaled_length, s->length, 1)))
> +           return err;

Does av_parse_time() allow negative values? If so, it might make more
sense to just call it unconditionally, then check for a negative value
instead of doing the string comparison.

> +AVFilter avfilter_af_alength = {
> +    .name           = "alength",
> +    .description    = NULL_IF_CONFIG_SMALL("Shorten or lengthen an audio 
> stream."),
> +    .priv_size      = sizeof(ALengthContext),
> +    .init           = alength_init,
> +
> +    .inputs         = (const AVFilterPad[]) {
> +        {
> +            .name          = "default",
> +            .config_props  = alength_config_input,
> +            .type          = AVMEDIA_TYPE_AUDIO,
> +            .filter_frame  = alength_filter_samples,
> +            .min_perms     = AV_PERM_READ | AV_PERM_WRITE

I don't see where you're modifying the input buffer. Why does this need
AV_PERM_WRITE?

> +        },
> +        { .name = NULL }
> +    },
> +
> +    .outputs        = (const AVFilterPad[]) {
> +        {
> +            .name          = "default",
> +            .config_props  = alength_config_output,
> +            .type          = AVMEDIA_TYPE_AUDIO,
> +            .request_frame = alength_request_frame,
> +        },
> +        { .name = NULL }
> +    },
> +};

Please split out the .inputs and .outputs like is done in all other filters.

The rest looks ok.

Thanks,
Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to