[FFmpeg-devel] [PATCH 2/2] avfilter/vf_scale2ref: switch to FFFrameSync
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Sun Mar 17 18:55:28 EET 2024
Niklas Haas:
>> This should be &tmp. It is probably the reason for Michael's segfault.
>> Apart from that: It is easier if you simply used 0..2 for *iter (1==
>> returned sws_get_class, 2 returned ff_framesync_child_class_iterate).
>
> Changed this function to:
>
> static const AVClass *child_class_iterate(void **iter)
> {
> void *tmp = NULL;
> switch ((uintptr_t)*iter) {
> case 0:
> *iter = (void*)(uintptr_t)1;
> return sws_get_class();
> case 1:
> *iter = (void*)(uintptr_t)2;
> return ff_framesync_child_class_iterate(&tmp);
> }
>
> return NULL;
> }
Better make framesync_class un-static and return that directly.
Also: It makes no sense for vf_scale's child_class_iterate and
child_next to return framesync-objects (even a framesync context whose
AVClass* has not been set!); but this is what your patch does.
- Andreas
More information about the ffmpeg-devel
mailing list