help glitch
in
Core Library Questions
•
1 year ago
I want to make a program that makes video glitchy the only problem is that my program keeps crashing...
and giving the following errors:
java(1464,0xb22cb000) malloc: *** error for object 0xffffffff: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
or sometimes
java(1500,0xad2942c0) malloc: *** error for object 0x1188a20: double free
*** set a breakpoint in malloc_error_break to debug
among others...
here's the code I have, Thank you very much for your help!!
import processing.video.*;
GlitchObject myGlitch;
boolean glitch = true;
PImage img;
Movie myMovie;
//as dimensoes myMovie.height e myMovie.width nao estao a funcionar,
//e necessario defini-las manualmente, dependendo do filme usado.
int movieHeight, movieWidth;
void setup() {
//dimensoes do clip de video
movieWidth = 960;
movieHeight = 540;
myMovie = new Movie(this,"processing.mov");
myMovie.play();
size(movieWidth, movieHeight,P3D);
myGlitch = new GlitchObject();
}
void draw() {
image(myMovie,0,0);
if (glitch) { myGlitch.run(); }
}
void mousePressed() {
glitch = !glitch;
}
// Called every time a new frame is available to read
void movieEvent(Movie m) {
m.read();
}
1