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:
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/anim.c7
-rw-r--r--source/blender/blenkernel/intern/armature.c8
-rw-r--r--source/blender/blenkernel/intern/blender.c4
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
-rw-r--r--source/blender/blenkernel/intern/node.c6
-rw-r--r--source/blender/blenkernel/intern/particle.c6
-rw-r--r--source/blender/blenkernel/intern/sequencer.c19
-rw-r--r--source/blender/blenkernel/intern/sound.c141
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c21
9 files changed, 149 insertions, 65 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 1763866c000..0747d87a0ab 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -171,7 +171,12 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *
avs= &ob->avs;
dst= &ob->mpath;
}
-
+
+ /* avoid 0 size allocs */
+ if(avs->path_sf >= avs->path_ef) {
+ return NULL;
+ }
+
/* if there is already a motionpath, just return that,
* but provided it's settings are ok
*/
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index fd25ebe266f..0b31e51d62e 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1343,8 +1343,12 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
cross_v3_v3v3(axis,target,nor);
/* was 0.0000000000001, caused bug [#23954], smaller values give unstable
- * roll when toggling editmode */
- if (dot_v3v3(axis,axis) > 0.00001f) {
+ * roll when toggling editmode.
+ *
+ * was 0.00001, causes bug [#27675], with 0.00000495,
+ * so a value inbetween these is needed.
+ */
+ if (dot_v3v3(axis,axis) > 0.000001f) {
/* if nor is *not* a multiple of target ... */
normalize_v3(axis);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 0f545ad3ff9..633a05589cd 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -64,6 +64,7 @@
#include "BLI_dynstr.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
+#include "BLI_callbacks.h"
#include "IMB_imbuf.h"
@@ -110,6 +111,9 @@ void free_blender(void)
BKE_spacetypes_free(); /* after free main, it uses space callbacks */
IMB_exit();
+
+ BLI_cb_finalize();
+
seq_stripelem_cache_destruct();
free_nodesystem();
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index cc45abb5998..c3aeb440938 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -719,7 +719,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
if(!data->cached)
BLI_bvhtree_free(data->tree);
- memset( data, 0, sizeof(data) );
+ memset( data, 0, sizeof(*data) );
}
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 3a8a2ae9c09..64e374fe4c0 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -32,8 +32,10 @@
*/
-#ifdef WITH_PYTHON
-#include <Python.h>
+#if 0 /* pynodes commented for now */
+# ifdef WITH_PYTHON
+# include <Python.h>
+# endif
#endif
#include "MEM_guardedalloc.h"
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index f71e2e9a6e9..72c92eed312 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3534,6 +3534,8 @@ static void default_particle_settings(ParticleSettings *part)
part->path_start = 0.0f;
part->path_end = 1.0f;
+ part->bb_size[0] = part->bb_size[1] = 1.0f;
+
part->keyed_loops = 1;
part->color_vec_max = 1.f;
@@ -4505,8 +4507,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI));
VECADD(yvec, yvec, tvec);
- mul_v3_fl(xvec, bb->size);
- mul_v3_fl(yvec, bb->size);
+ mul_v3_fl(xvec, bb->size[0]);
+ mul_v3_fl(yvec, bb->size[1]);
VECADDFAC(center, bb->vec, xvec, bb->offset[0]);
VECADDFAC(center, center, yvec, bb->offset[1]);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index b82ac69fc9e..265cc3eeb79 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -73,7 +73,10 @@
#include "BKE_context.h"
#include "BKE_sound.h"
-#include "AUD_C-API.h"
+
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#ifdef WIN32
#define snprintf _snprintf
@@ -697,6 +700,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
}
seq->strip->len = seq->len;
case SEQ_SOUND:
+#ifdef WITH_AUDASPACE
if(!seq->sound)
return;
seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS);
@@ -706,6 +710,9 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
seq->len = 0;
}
seq->strip->len = seq->len;
+#else
+ return;
+#endif
break;
case SEQ_SCENE:
{
@@ -3493,6 +3500,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
return seq;
}
+#ifdef WITH_AUDASPACE
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
Scene *scene= CTX_data_scene(C); /* only for sound */
@@ -3550,6 +3558,15 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
return seq;
}
+#else // WITH_AUDASPACE
+Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
+{
+ (void)C;
+ (void)seqbasep;
+ (void)seq_load;
+ return NULL;
+}
+#endif // WITH_AUDASPACE
Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index e0e456a371e..0eb2392b012 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -21,7 +21,9 @@
#include "DNA_screen_types.h"
#include "DNA_sound_types.h"
-#include "AUD_C-API.h"
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "BKE_utildefines.h"
#include "BKE_global.h"
@@ -36,6 +38,62 @@
static int force_device = -1;
+
+struct bSound* sound_new_file(struct Main *bmain, const char *filename)
+{
+ bSound* sound = NULL;
+
+ char str[FILE_MAX];
+ char *path;
+
+ int len;
+
+ strcpy(str, filename);
+
+ path = /*bmain ? bmain->name :*/ G.main->name;
+
+ BLI_path_abs(str, path);
+
+ len = strlen(filename);
+ while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
+ len--;
+
+ sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
+ BLI_strncpy(sound->name, filename, FILE_MAX);
+// XXX unused currently sound->type = SOUND_TYPE_FILE;
+
+ sound_load(bmain, sound);
+
+ if(!sound->playback_handle)
+ {
+ free_libblock(&bmain->sound, sound);
+ sound = NULL;
+ }
+
+ return sound;
+}
+
+void sound_free(struct bSound* sound)
+{
+ if (sound->packedfile)
+ {
+ freePackedFile(sound->packedfile);
+ sound->packedfile = NULL;
+ }
+
+#ifdef WITH_AUDASPACE
+ if(sound->handle)
+ {
+ AUD_unload(sound->handle);
+ sound->handle = NULL;
+ sound->playback_handle = NULL;
+ }
+#endif // WITH_AUDASPACE
+}
+
+
+#ifdef WITH_AUDASPACE
+
#ifdef WITH_JACK
static void sound_sync_callback(void* data, int mode, float time)
{
@@ -123,40 +181,6 @@ void sound_exit(void)
AUD_exit();
}
-struct bSound* sound_new_file(struct Main *bmain, const char *filename)
-{
- bSound* sound = NULL;
-
- char str[FILE_MAX];
- char *path;
-
- int len;
-
- strcpy(str, filename);
-
- path = /*bmain ? bmain->name :*/ G.main->name;
-
- BLI_path_abs(str, path);
-
- len = strlen(filename);
- while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
- len--;
-
- sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
- BLI_strncpy(sound->name, filename, FILE_MAX);
-// XXX unused currently sound->type = SOUND_TYPE_FILE;
-
- sound_load(bmain, sound);
-
- if(!sound->playback_handle)
- {
- free_libblock(&bmain->sound, sound);
- sound = NULL;
- }
-
- return sound;
-}
-
// XXX unused currently
#if 0
struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
@@ -301,22 +325,6 @@ void sound_load(struct Main *bmain, struct bSound* sound)
}
}
-void sound_free(struct bSound* sound)
-{
- if (sound->packedfile)
- {
- freePackedFile(sound->packedfile);
- sound->packedfile = NULL;
- }
-
- if(sound->handle)
- {
- AUD_unload(sound->handle);
- sound->handle = NULL;
- sound->playback_handle = NULL;
- }
-}
-
static float sound_get_volume(Scene* scene, Sequence* sequence, float time)
{
AnimData *adt= BKE_animdata_from_id(&scene->id);
@@ -502,3 +510,34 @@ int sound_get_channels(struct bSound* sound)
return info.specs.channels;
}
+
+#else // WITH_AUDASPACE
+
+#include "BLI_utildefines.h"
+
+int sound_define_from_str(const char *UNUSED(str)) { return -1;}
+void sound_force_device(int UNUSED(device)) {}
+void sound_init_once(void) {}
+void sound_init(struct Main *UNUSED(bmain)) {}
+void sound_exit(void) {}
+void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { }
+void sound_delete_cache(struct bSound* UNUSED(sound)) {}
+void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
+void sound_create_scene(struct Scene *UNUSED(scene)) {}
+void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
+void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
+void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
+void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {}
+void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
+static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
+void sound_play_scene(struct Scene *UNUSED(scene)) {}
+void sound_stop_scene(struct Scene *UNUSED(scene)) {}
+void sound_seek_scene(struct bContext *UNUSED(C)) {}
+float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
+int sound_scene_playing(struct Scene *UNUSED(scene)) { return 0; }
+int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
+int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
+
+#endif // WITH_AUDASPACE
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index c729565533f..4db53999f10 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -49,7 +49,9 @@
#include "BLI_blenlib.h"
-#include "AUD_C-API.h" /* must be before BKE_sound.h for define */
+#ifdef WITH_AUDASPACE
+# include "AUD_C-API.h"
+#endif
#include "BKE_global.h"
#include "BKE_idprop.h"
@@ -89,7 +91,9 @@ static uint8_t* audio_output_buffer = 0;
static int audio_outbuf_size = 0;
static double audio_time = 0.0f;
+#ifdef WITH_AUDASPACE
static AUD_Device* audio_mixdown_device = 0;
+#endif
#define FFMPEG_AUTOSPLIT_SIZE 2000000000
@@ -103,6 +107,7 @@ static void delete_picture(AVFrame* f)
}
}
+#ifdef WITH_AUDASPACE
static int write_audio_frame(void)
{
AVCodecContext* c = NULL;
@@ -145,6 +150,7 @@ static int write_audio_frame(void)
}
return 0;
}
+#endif // #ifdef WITH_AUDASPACE
/* Allocate a temporary frame */
static AVFrame* alloc_picture(int pix_fmt, int width, int height)
@@ -851,7 +857,7 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
ffmpeg_autosplit_count = 0;
success = start_ffmpeg_impl(rd, rectx, recty, reports);
-
+#ifdef WITH_AUDASPACE
if(audio_stream)
{
AVCodecContext* c = audio_stream->codec;
@@ -861,12 +867,13 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
specs.rate = rd->ffcodecdata.audio_mixrate;
audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume);
}
-
+#endif
return success;
}
void end_ffmpeg(void);
+#ifdef WITH_AUDASPACE
static void write_audio_frames(double to_pts)
{
int finished = 0;
@@ -878,6 +885,7 @@ static void write_audio_frames(double to_pts)
}
}
}
+#endif
int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports)
{
@@ -905,8 +913,9 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty,
}
}
+#ifdef WITH_AUDASPACE
write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base));
-
+#endif
return success;
}
@@ -920,12 +929,14 @@ void end_ffmpeg(void)
write_audio_frames();
}*/
+#ifdef WITH_AUDASPACE
if(audio_mixdown_device)
{
AUD_closeReadDevice(audio_mixdown_device);
audio_mixdown_device = 0;
}
-
+#endif
+
if (video_stream && video_stream->codec) {
fprintf(stderr, "Flushing delayed frames...\n");
flush_ffmpeg ();