summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-14 09:58:48 +0200
committerwm4 <wm4@nowhere>2014-06-14 09:58:48 +0200
commit6ab72f976035f094406584795f680d2de8761c2b (patch)
treea0a78435bd651c01542d510477c8f4d07d20e9b0 /video/filter
parent6842d4bde5977a7bd76c4492e5a27e4b716fd5ec (diff)
downloadmpv-6ab72f976035f094406584795f680d2de8761c2b.tar.bz2
mpv-6ab72f976035f094406584795f680d2de8761c2b.tar.xz
video: automatically strip "le" and "be" suffix from pixle format names
These suffixes are annoying when they're redundant, so strip them automatically. On little endian machines, always strip the "le" suffix, and on big endian machines vice versa (although I don't think anyone ever tried to run mpv on a big endian machine). Since pixel format strings are returned by a certain function and we can't just change static strings, use a trick to pass a stack buffer transparently. But this also means the string can't be permanently stored by the caller, so vf_dlopen.c has to be updated. There seems to be no other case where this is done, though.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_dlopen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/filter/vf_dlopen.c b/video/filter/vf_dlopen.c
index 1646d3fbcf..9f9cd20318 100644
--- a/video/filter/vf_dlopen.c
+++ b/video/filter/vf_dlopen.c
@@ -102,7 +102,7 @@ static int config(struct vf_instance *vf,
vf->priv->filter.in_height = height;
vf->priv->filter.in_d_width = d_width;
vf->priv->filter.in_d_height = d_height;
- vf->priv->filter.in_fmt = mp_imgfmt_to_name(fmt);
+ vf->priv->filter.in_fmt = talloc_strdup(vf, mp_imgfmt_to_name(fmt));
vf->priv->filter.out_width = width;
vf->priv->filter.out_height = height;
vf->priv->filter.out_d_width = d_width;
@@ -142,7 +142,8 @@ static int config(struct vf_instance *vf,
}
} else
vf->priv->outfmt = fmt;
- vf->priv->filter.out_fmt = mp_imgfmt_to_name(vf->priv->outfmt);
+ vf->priv->filter.out_fmt =
+ talloc_strdup(vf, mp_imgfmt_to_name(vf->priv->outfmt));
}
if (!vf->priv->outfmt) {