void IMB_free_anim(struct anim *anim) { if (anim == NULL) { printf("free anim, anim == NULL\n"); return; } free_anim_movie(anim); #ifdef WITH_AVI free_anim_avi(anim); #endif #ifdef WITH_QUICKTIME free_anim_quicktime(anim); #endif #ifdef WITH_FFMPEG free_anim_ffmpeg(anim); #endif #ifdef WITH_REDCODE free_anim_redcode(anim); #endif IMB_free_indices(anim); MEM_freeN(anim); }
static ImBuf *anim_getnew(struct anim *anim) { struct ImBuf *ibuf = NULL; if (anim == NULL) return(NULL); free_anim_movie(anim); #ifdef WITH_AVI free_anim_avi(anim); #endif #ifdef WITH_QUICKTIME free_anim_quicktime(anim); #endif #ifdef WITH_FFMPEG free_anim_ffmpeg(anim); #endif if (anim->curtype != 0) return (NULL); anim->curtype = imb_get_anim_type(anim->name); switch (anim->curtype) { case ANIM_SEQUENCE: ibuf = IMB_loadiffname(anim->name, anim->ib_flags, anim->colorspace); if (ibuf) { BLI_strncpy(anim->first, anim->name, sizeof(anim->first)); anim->duration = 1; } break; case ANIM_MOVIE: if (startmovie(anim)) return (NULL); ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); /* fake */ break; #ifdef WITH_AVI case ANIM_AVI: if (startavi(anim)) { printf("couldnt start avi\n"); return (NULL); } ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); break; #endif #ifdef WITH_QUICKTIME case ANIM_QTIME: if (startquicktime(anim)) return (0); ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); break; #endif #ifdef WITH_FFMPEG case ANIM_FFMPEG: if (startffmpeg(anim)) return (0); ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); break; #endif } return(ibuf); }