mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
sws_utils: work around libswscale crash with --contrast=-100
This commit is contained in:
parent
20e1c5f7d9
commit
1eda9554d4
@ -24,6 +24,7 @@
|
||||
|
||||
#include "sws_utils.h"
|
||||
|
||||
#include "mpvcore/mp_common.h"
|
||||
#include "video/mp_image.h"
|
||||
#include "video/img_format.h"
|
||||
#include "fmt-conversion.h"
|
||||
@ -327,7 +328,7 @@ int mp_sws_set_vf_equalizer(struct mp_sws_context *sws, struct vf_seteq *eq)
|
||||
if (!strcmp(eq->item, "brightness"))
|
||||
sws->brightness = ((eq->value << 16) + 50) / 100;
|
||||
else if (!strcmp(eq->item, "contrast"))
|
||||
sws->contrast = (((eq->value + 100) << 16) + 50) / 100;
|
||||
sws->contrast = MPMAX(1, (((eq->value + 100) << 16) + 50) / 100);
|
||||
else if (!strcmp(eq->item, "saturation"))
|
||||
sws->saturation = (((eq->value + 100) << 16) + 50) / 100;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user