From 32833fa3d14b78cd2a481641cfa174d4bee6533e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 18 Jun 2017 13:58:42 +0200 Subject: img_format: minor simplification --- options/m_option.c | 2 +- video/img_format.c | 4 +--- video/img_format.h | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/options/m_option.c b/options/m_option.c index a7bf05cec5..bec2518b45 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2069,7 +2069,7 @@ static int parse_imgfmt(struct mp_log *log, const m_option_t *opt, return M_OPT_EXIT; } - unsigned int fmt = mp_imgfmt_from_name(param, true); + unsigned int fmt = mp_imgfmt_from_name(param); if (!fmt && !(accept_no && bstr_equals0(param, "no"))) { mp_err(log, "Option %.*s: unknown format name: '%.*s'\n", BSTR_P(name), BSTR_P(param)); diff --git a/video/img_format.c b/video/img_format.c index 64b459bcfb..523caff87a 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -58,7 +58,7 @@ char **mp_imgfmt_name_list(void) return list; } -int mp_imgfmt_from_name(bstr name, bool allow_hwaccel) +int mp_imgfmt_from_name(bstr name) { int img_fmt = 0; for (const struct mp_imgfmt_entry *p = mp_imgfmt_list; p->name; ++p) { @@ -72,8 +72,6 @@ int mp_imgfmt_from_name(bstr name, bool allow_hwaccel) img_fmt = pixfmt2imgfmt(av_get_pix_fmt(t)); talloc_free(t); } - if (!allow_hwaccel && IMGFMT_IS_HWACCEL(img_fmt)) - return 0; return img_fmt; } diff --git a/video/img_format.h b/video/img_format.h index ee731aa51c..8207ff87d3 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -236,7 +236,7 @@ static inline bool IMGFMT_IS_RGB(int fmt) #define IMGFMT_RGB_DEPTH(fmt) (mp_imgfmt_get_desc(fmt).plane_bits) #define IMGFMT_IS_HWACCEL(fmt) (mp_imgfmt_get_desc(fmt).flags & MP_IMGFLAG_HWACCEL) -int mp_imgfmt_from_name(bstr name, bool allow_hwaccel); +int mp_imgfmt_from_name(bstr name); char *mp_imgfmt_to_name_buf(char *buf, size_t buf_size, int fmt); #define mp_imgfmt_to_name(fmt) mp_imgfmt_to_name_buf((char[16]){0}, 16, (fmt)) -- cgit v1.2.3