[FFmpeg-devel] [PATCH 2/2] avfilter: make frame writable before writing it

wm4 nfxjfg at googlemail.com
Sat Jan 28 17:34:30 EET 2017


On Sat, 28 Jan 2017 22:23:54 +0700
Muhammad Faiz <mfcc64 at gmail.com> wrote:

> affect filters that set partial_buf_size
> test-case
> ffplay -i lavfi 'aevalsrc=sin(1000*t*t), aformat=sample_fmts=fltp, asplit [a][b];
> [a] firequalizer=fixed=on, showcqt=s=1280x360 [a1];
> [b] firequalizer=fixed=on, showcqt=s=1280x360 [b1];
> [a1][b1] vstack'
> 
> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> ---
>  libavfilter/avfilter.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index c8dafd2..55c653d 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -1235,6 +1235,11 @@ static int take_samples(AVFilterLink *link, unsigned min, unsigned max,
>          frame = ff_framequeue_peek(&link->fifo, 0);
>          av_samples_copy(buf->extended_data, frame->extended_data, p, 0, n,
>                          link->channels, link->format);
> +
> +        ret = ff_inlink_make_frame_writable(link, frame);
> +        if (ret < 0)
> +            return ret;
> +
>          frame->nb_samples -= n;
>          av_samples_copy(frame->extended_data, frame->extended_data, 0, n,
>                          frame->nb_samples, link->channels, link->format);

Obviously OK.


More information about the ffmpeg-devel mailing list