diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-05-07 11:18:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-05-07 11:18:15 +0300 |
commit | 5d7de5745b0f291027223b976f8e87158c6f3e4b (patch) | |
tree | 91d8124ff153e7126c5389b5946f11896bab4068 /source/blender | |
parent | eaffa83fecafc9fe9f922c8eed04d7eae1a5a3c8 (diff) | |
parent | 5052ab755885cae985f267eb71f8d5572b3e90a8 (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index a209930f978..d7fdcc7e4af 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -273,6 +273,28 @@ static struct { }; #endif /* USE_FRAME_CACHE_LIMIT */ +static ImBuf *ibuf_from_picture(PlayAnimPict *pic) +{ + ImBuf *ibuf = NULL; + + if (pic->ibuf) { + ibuf = pic->ibuf; + } + else if (pic->anim) { + ibuf = IMB_anim_absolute(pic->anim, pic->frame, IMB_TC_NONE, IMB_PROXY_NONE); + } + else if (pic->mem) { + /* use correct colorspace here */ + ibuf = IMB_ibImageFromMemory(pic->mem, pic->size, pic->IB_flags, NULL, pic->name); + } + else { + /* use correct colorspace here */ + ibuf = IMB_loadiffname(pic->name, pic->IB_flags, NULL); + } + + return ibuf; +} + static PlayAnimPict *playanim_step(PlayAnimPict *playanim, int step) { if (step > 0) { @@ -641,14 +663,7 @@ static void build_pict_list_ex( if (ptottime > 1.0) { /* OCIO_TODO: support different input color space */ - struct ImBuf *ibuf; - if (picture->mem) { - ibuf = IMB_ibImageFromMemory( - picture->mem, picture->size, picture->IB_flags, NULL, picture->name); - } - else { - ibuf = IMB_loadiffname(picture->name, picture->IB_flags, NULL); - } + ImBuf *ibuf = ibuf_from_picture(picture); if (ibuf) { playanim_toscreen(ps, picture, ibuf, fontid, fstep); IMB_freeImBuf(ibuf); @@ -1549,21 +1564,8 @@ static char *wm_main_playanim_intern(int argc, const char **argv) IMB_freeImBuf(ibuf); } #endif - if (ps.picture->ibuf) { - ibuf = ps.picture->ibuf; - } - else if (ps.picture->anim) { - ibuf = IMB_anim_absolute(ps.picture->anim, ps.picture->frame, IMB_TC_NONE, IMB_PROXY_NONE); - } - else if (ps.picture->mem) { - /* use correct colorspace here */ - ibuf = IMB_ibImageFromMemory( - ps.picture->mem, ps.picture->size, ps.picture->IB_flags, NULL, ps.picture->name); - } - else { - /* use correct colorspace here */ - ibuf = IMB_loadiffname(ps.picture->name, ps.picture->IB_flags, NULL); - } + + ibuf = ibuf_from_picture(ps.picture); if (ibuf) { #ifdef USE_IMB_CACHE |