summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-06-04 14:50:32 +0200
committerwm4 <wm4@nowhere>2016-06-04 14:50:32 +0200
commit2dfea67f3b23106148f48840d19f4ec44ad7eeb8 (patch)
tree519b81fd39d1264deca315b0a56b73a092f9695a
parenta9ffe38aa115e78ed8aa6031cd611db650ec40dd (diff)
downloadmpv-2dfea67f3b23106148f48840d19f4ec44ad7eeb8.tar.bz2
mpv-2dfea67f3b23106148f48840d19f4ec44ad7eeb8.tar.xz
vo_opengl: minor simplification to gl_lcms_set_memory_profile()
Passing the bstr thing as pointer makes no sense. Everywhere else bstr structs are passed by value because they're so small. Only when it's supposed to receive a return value they're not.
-rw-r--r--video/out/opengl/lcms.c18
-rw-r--r--video/out/opengl/lcms.h2
-rw-r--r--video/out/opengl/video.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/video/out/opengl/lcms.c b/video/out/opengl/lcms.c
index 374ddb0b4c..d847906dcd 100644
--- a/video/out/opengl/lcms.c
+++ b/video/out/opengl/lcms.c
@@ -143,18 +143,18 @@ void gl_lcms_set_options(struct gl_lcms *p, struct mp_icc_opts *opts)
// Warning: profile.start must point to a ta allocation, and the function
// takes over ownership.
-void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr *profile)
+void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr profile)
{
if (!p->opts.profile_auto || (p->icc_path && p->icc_path[0])) {
- talloc_free(profile->start);
+ talloc_free(profile.start);
return;
}
- if (!p->icc_path && p->icc_data && profile->start &&
- profile->len == p->icc_size &&
- memcmp(profile->start, p->icc_data, p->icc_size) == 0)
+ if (!p->icc_path && p->icc_data && profile.start &&
+ profile.len == p->icc_size &&
+ memcmp(profile.start, p->icc_data, p->icc_size) == 0)
{
- talloc_free(profile->start);
+ talloc_free(profile.start);
return;
}
@@ -165,8 +165,8 @@ void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr *profile)
talloc_free(p->icc_data);
- p->icc_data = talloc_steal(p, profile->start);
- p->icc_size = profile->len;
+ p->icc_data = talloc_steal(p, profile.start);
+ p->icc_size = profile.len;
}
// Return and _reset_ whether the profile or config has changed since the last
@@ -436,7 +436,7 @@ struct gl_lcms *gl_lcms_init(void *talloc_ctx, struct mp_log *log,
}
void gl_lcms_set_options(struct gl_lcms *p, struct mp_icc_opts *opts) { }
-void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr *profile) { }
+void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr profile) { }
bool gl_lcms_has_changed(struct gl_lcms *p, enum mp_csp_prim prim,
enum mp_csp_trc trc)
diff --git a/video/out/opengl/lcms.h b/video/out/opengl/lcms.h
index 373a8b8669..2c6543d953 100644
--- a/video/out/opengl/lcms.h
+++ b/video/out/opengl/lcms.h
@@ -28,7 +28,7 @@ struct gl_lcms;
struct gl_lcms *gl_lcms_init(void *talloc_ctx, struct mp_log *log,
struct mpv_global *global);
void gl_lcms_set_options(struct gl_lcms *p, struct mp_icc_opts *opts);
-void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr *profile);
+void gl_lcms_set_memory_profile(struct gl_lcms *p, bstr profile);
bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **,
enum mp_csp_prim prim, enum mp_csp_trc trc);
bool gl_lcms_has_changed(struct gl_lcms *p, enum mp_csp_prim prim,
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 3982793f94..7eb7736c04 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -613,7 +613,7 @@ static void uninit_rendering(struct gl_video *p)
// takes over ownership.
void gl_video_set_icc_profile(struct gl_video *p, bstr icc_data)
{
- gl_lcms_set_memory_profile(p->cms, &icc_data);
+ gl_lcms_set_memory_profile(p->cms, icc_data);
if (p->use_lut_3d)
return;