Merge branch 'blender-v3.1-release'

This commit is contained in:
Sebastian Parborg 2022-02-22 17:34:07 +01:00
commit 8ae77efe4e
2 changed files with 16 additions and 6 deletions

View File

@ -4,12 +4,13 @@
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavutil/channel_layout.h>
#include <libavutil/log.h>
}
namespace {
bool test_vcodec(AVCodec *codec, AVPixelFormat pixelformat)
bool test_vcodec(const AVCodec *codec, AVPixelFormat pixelformat)
{
av_log_set_level(AV_LOG_QUIET);
bool result = false;
@ -30,7 +31,7 @@ bool test_vcodec(AVCodec *codec, AVPixelFormat pixelformat)
}
return result;
}
bool test_acodec(AVCodec *codec, AVSampleFormat fmt)
bool test_acodec(const AVCodec *codec, AVSampleFormat fmt)
{
av_log_set_level(AV_LOG_QUIET);
bool result = false;
@ -54,7 +55,7 @@ bool test_acodec(AVCodec *codec, AVSampleFormat fmt)
bool test_codec_video_by_codecid(AVCodecID codec_id, AVPixelFormat pixelformat)
{
bool result = false;
AVCodec *codec = avcodec_find_encoder(codec_id);
const AVCodec *codec = avcodec_find_encoder(codec_id);
if (codec)
result = test_vcodec(codec, pixelformat);
return result;
@ -63,7 +64,7 @@ bool test_codec_video_by_codecid(AVCodecID codec_id, AVPixelFormat pixelformat)
bool test_codec_video_by_name(const char *codecname, AVPixelFormat pixelformat)
{
bool result = false;
AVCodec *codec = avcodec_find_encoder_by_name(codecname);
const AVCodec *codec = avcodec_find_encoder_by_name(codecname);
if (codec)
result = test_vcodec(codec, pixelformat);
return result;
@ -72,7 +73,7 @@ bool test_codec_video_by_name(const char *codecname, AVPixelFormat pixelformat)
bool test_codec_audio_by_codecid(AVCodecID codec_id, AVSampleFormat fmt)
{
bool result = false;
AVCodec *codec = avcodec_find_encoder(codec_id);
const AVCodec *codec = avcodec_find_encoder(codec_id);
if (codec)
result = test_acodec(codec, fmt);
return result;
@ -81,7 +82,7 @@ bool test_codec_audio_by_codecid(AVCodecID codec_id, AVSampleFormat fmt)
bool test_codec_audio_by_name(const char *codecname, AVSampleFormat fmt)
{
bool result = false;
AVCodec *codec = avcodec_find_encoder_by_name(codecname);
const AVCodec *codec = avcodec_find_encoder_by_name(codecname);
if (codec)
result = test_acodec(codec, fmt);
return result;

View File

@ -21,6 +21,7 @@
#include "BKE_customdata.h"
#include "BKE_editmesh.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
@ -1110,6 +1111,8 @@ static void mesh_add_verts(Mesh *mesh, int len)
mesh->vdata = vdata;
BKE_mesh_update_customdata_pointers(mesh, false);
BKE_mesh_runtime_clear_cache(mesh);
/* scan the input list and insert the new vertices */
/* set default flags */
@ -1146,6 +1149,8 @@ static void mesh_add_edges(Mesh *mesh, int len)
mesh->edata = edata;
BKE_mesh_update_customdata_pointers(mesh, false); /* new edges don't change tessellation */
BKE_mesh_runtime_clear_cache(mesh);
/* set default flags */
medge = &mesh->medge[mesh->totedge];
for (i = 0; i < len; i++, medge++) {
@ -1174,6 +1179,8 @@ static void mesh_add_loops(Mesh *mesh, int len)
CustomData_add_layer(&ldata, CD_MLOOP, CD_CALLOC, NULL, totloop);
}
BKE_mesh_runtime_clear_cache(mesh);
CustomData_free(&mesh->ldata, mesh->totloop);
mesh->ldata = ldata;
BKE_mesh_update_customdata_pointers(mesh, true);
@ -1205,6 +1212,8 @@ static void mesh_add_polys(Mesh *mesh, int len)
mesh->pdata = pdata;
BKE_mesh_update_customdata_pointers(mesh, true);
BKE_mesh_runtime_clear_cache(mesh);
/* set default flags */
mpoly = &mesh->mpoly[mesh->totpoly];
for (i = 0; i < len; i++, mpoly++) {