Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-02-05 18:50:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-02-05 18:52:36 +0300
commit08ab09cf04d93520118460b3d1f243313b7892b8 (patch)
tree71b2852270fb653a041266bf789cee842cd0f461 /source/blender/blenkernel/intern/movieclip.c
parent3467e40e01fd84c322189329a4f38ac830bc4729 (diff)
Clip editor: Fixes for prefetch
Seems metadata was never read while prefetching, at least was never requested to be read. Also fixed prefetch for multilayer EXR.
Diffstat (limited to 'source/blender/blenkernel/intern/movieclip.c')
-rw-r--r--source/blender/blenkernel/intern/movieclip.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 5d2616b7720..b67a39494c3 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -197,6 +197,8 @@ static void get_proxy_fname(const MovieClip *clip,
strcat(name, ".jpg");
}
+#ifdef WITH_OPENEXR
+
typedef struct MultilayerConvertContext {
float *combined_pass;
int num_combined_channels;
@@ -247,12 +249,21 @@ static void movieclip_convert_multilayer_add_pass(
}
}
+#endif /* WITH_OPENEXR */
+
/* Will try to make image buffer usable when originating from the multi-layer
* source.
* Internally finds a first combined pass and uses that as a buffer. Not ideal,
* but is better than a complete empty buffer. */
-static void movieclip_convert_multilayer(ImBuf *ibuf)
+void BKE_movieclip_convert_multilayer_ibuf(struct ImBuf *ibuf)
{
+ if (ibuf == NULL) {
+ return;
+ }
+#ifdef WITH_OPENEXR
+ if (ibuf->ftype != IMB_FTYPE_OPENEXR || ibuf->userdata == NULL) {
+ return;
+ }
MultilayerConvertContext ctx;
ctx.combined_pass = NULL;
ctx.num_combined_channels = 0;
@@ -271,6 +282,7 @@ static void movieclip_convert_multilayer(ImBuf *ibuf)
}
IMB_exr_close(ibuf->userdata);
ibuf->userdata = NULL;
+#endif
}
static ImBuf *movieclip_load_sequence_file(MovieClip *clip,
@@ -310,14 +322,7 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip,
/* read ibuf */
ibuf = IMB_loadiffname(name, loadflag, colorspace);
-
-#ifdef WITH_OPENEXR
- if (ibuf) {
- if (ibuf->ftype == IMB_FTYPE_OPENEXR && ibuf->userdata) {
- movieclip_convert_multilayer(ibuf);
- }
- }
-#endif
+ BKE_movieclip_convert_multilayer_ibuf(ibuf);
return ibuf;
}