[FFmpeg-devel] [PATCH] avfilter: do not write to unwritable frame

Muhammad Faiz mfcc64 at gmail.com
Sat Jan 28 17:29:56 EET 2017


On 1/28/17, wm4 <nfxjfg at googlemail.com> wrote:
> On Sat, 28 Jan 2017 15:59:11 +0700
> Muhammad Faiz <mfcc64 at gmail.com> wrote:
>
>> On 1/28/17, Nicolas George <george at nsup.org> wrote:
>> > L'octidi 8 pluviôse, an CCXXV, Muhammad Faiz a écrit :
>> >> 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 | 17 +++++++++++++++++
>> >>  1 file changed, 17 insertions(+)
>> >
>> > Maybe this can be of use:
>> >
>> > https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/28c62df672865890cbb13e5f0e94bde29c8fbacd
>> >
>>
>> Unfortunately, this modify pointer to AVFrame, i think it is incompatible
>> with framequeue framework.
>>
>> Note that av_frame_make_writable() takes AVFrame*,
>> while ff_inlink_make_frame_writable() takes AVFrame**.
>
> There doesn't seem to be any reason that it takes AVFrame**. AVFrame
> refs can be moved, so even if a frame is newly allocated it can be put
> into the AVFrame passed to the function without replacing the pointer.
>
> Also the code for copying the data in the function could have be
> reduced to 1 line by using av_frame_copy().
>
> Maybe someone should have reviewed the commit that added this.
>
> Anyway, maybe you can fix it and use it. That would be the ideal
> outcome.

Good idea. I've posted it.

Thank's


More information about the ffmpeg-devel mailing list