diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c index 12d57e0875619ffc109194478349caf66b46eec7..89763345d9a9f134a4764b4fad85573064baffe3 100644 --- a/libavfilter/vf_avgblur_vulkan.c +++ b/libavfilter/vf_avgblur_vulkan.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/random_seed.h" #include "libavutil/opt.h" #include "vulkan.h" #include "internal.h" @@ -99,7 +100,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->vkctx.queue_family_idx = s->vkctx.hwctx->queue_family_comp_index; s->vkctx.queue_count = GET_QUEUE_COUNT(s->vkctx.hwctx, 0, 1, 0); - s->vkctx.cur_queue_idx = rand() % s->vkctx.queue_count; + s->vkctx.cur_queue_idx = av_get_random_seed() % s->vkctx.queue_count; { /* Create shader for the horizontal pass */ desc_i[0].updater = s->input_images; diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c index 1bee5e10f8a16be77bae11efdefbebd6517f0d5c..12dfebb1fefcdd5f34b45d23a9c76ee238c5e607 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/random_seed.h" #include "libavutil/opt.h" #include "vulkan.h" #include "internal.h" @@ -75,7 +76,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->vkctx.queue_family_idx = s->vkctx.hwctx->queue_family_comp_index; s->vkctx.queue_count = GET_QUEUE_COUNT(s->vkctx.hwctx, 0, 1, 0); - s->vkctx.cur_queue_idx = rand() % s->vkctx.queue_count; + s->vkctx.cur_queue_idx = av_get_random_seed() % s->vkctx.queue_count; s->pl = ff_vk_create_pipeline(ctx); if (!s->pl) diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c index 60a73564563d0644e90f52f06dc88296aad77bb7..60ca85fd08527b4363ab2c25d9801773861dd98c 100644 --- a/libavfilter/vf_overlay_vulkan.c +++ b/libavfilter/vf_overlay_vulkan.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/random_seed.h" #include "libavutil/opt.h" #include "vulkan.h" #include "internal.h" @@ -89,7 +90,7 @@ static av_cold int init_filter(AVFilterContext *ctx) s->vkctx.queue_family_idx = s->vkctx.hwctx->queue_family_comp_index; s->vkctx.queue_count = GET_QUEUE_COUNT(s->vkctx.hwctx, 0, 1, 0); - s->vkctx.cur_queue_idx = rand() % s->vkctx.queue_count; + s->vkctx.cur_queue_idx = av_get_random_seed() % s->vkctx.queue_count; { /* Create the shader */ const int planes = av_pix_fmt_count_planes(s->vkctx.output_format); diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index 9b2e5b92f6af490f217c93b7e5d266d7b9dc9aa1..35ea2e1e5d28d52af5434cceff6620ce0367829c 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/random_seed.h" #include "libavutil/opt.h" #include "vulkan.h" #include "scale_eval.h" @@ -117,7 +118,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->vkctx.queue_family_idx = s->vkctx.hwctx->queue_family_comp_index; s->vkctx.queue_count = GET_QUEUE_COUNT(s->vkctx.hwctx, 0, 1, 0); - s->vkctx.cur_queue_idx = rand() % s->vkctx.queue_count; + s->vkctx.cur_queue_idx = av_get_random_seed() % s->vkctx.queue_count; switch (s->scaler) { case F_NEAREST: