summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-03 22:48:49 +0100
committerwm4 <wm4@nowhere>2019-11-03 22:48:49 +0100
commita19571679f2b7f6c5e1faf9a08c6c1a16c62389c (patch)
treecf2c951fe6b9e6a2bb2a69383b5677c89bfe84e1 /video
parent67e17f1104761cd27cfa690d1d5f69d99db081ed (diff)
downloadmpv-a19571679f2b7f6c5e1faf9a08c6c1a16c62389c.tar.bz2
mpv-a19571679f2b7f6c5e1faf9a08c6c1a16c62389c.tar.xz
sws_utils: remove some unnecessary sws bug work around
Seems like this was needed in 2012. The comment indicates the bug was fixed in ffmpeg git, so it's long gone.
Diffstat (limited to 'video')
-rw-r--r--video/sws_utils.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c
index c22b13109b..ce22e79e03 100644
--- a/video/sws_utils.c
+++ b/video/sws_utils.c
@@ -251,11 +251,6 @@ int mp_sws_reinit(struct mp_sws_context *ctx)
mp_image_params_guess_csp(src); // sanitize colorspace/colorlevels
mp_image_params_guess_csp(dst);
- struct mp_imgfmt_desc src_fmt = mp_imgfmt_get_desc(src->imgfmt);
- struct mp_imgfmt_desc dst_fmt = mp_imgfmt_get_desc(dst->imgfmt);
- if (!src_fmt.id || !dst_fmt.id)
- return -1;
-
enum AVPixelFormat s_fmt = imgfmt2pixfmt(src->imgfmt);
if (s_fmt == AV_PIX_FMT_NONE || sws_isSupportedInput(s_fmt) < 1) {
MP_ERR(ctx, "Input image format %s not supported by libswscale.\n",
@@ -276,12 +271,6 @@ int mp_sws_reinit(struct mp_sws_context *ctx)
int d_csp = mp_csp_to_sws_colorspace(dst->color.space);
int d_range = dst->color.levels == MP_CSP_LEVELS_PC;
- // Work around libswscale bug #1852 (fixed in ffmpeg commit 8edf9b1fa):
- // setting range flags for RGB gives random bogus results.
- // Newer libswscale always ignores range flags for RGB.
- s_range = s_range && (src_fmt.flags & MP_IMGFLAG_YUV);
- d_range = d_range && (dst_fmt.flags & MP_IMGFLAG_YUV);
-
av_opt_set_int(ctx->sws, "sws_flags", ctx->flags, 0);
av_opt_set_int(ctx->sws, "srcw", src->w, 0);