fixed playback/export flickering and hanging
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "project/clip.h"
|
||||
#include "project/sequence.h"
|
||||
#include "debug.h"
|
||||
|
||||
ToneEffect::ToneEffect(Clip* c) : Effect(c, EFFECT_TYPE_AUDIO, AUDIO_TONE_EFFECT), sinX(INT_MIN) {
|
||||
type_val = add_row("Type:")->add_field(EFFECT_FIELD_COMBO);
|
||||
@@ -54,7 +55,7 @@ void ToneEffect::process_audio(double timecode_start, double timecode_end, quint
|
||||
int presin = sinX;
|
||||
sinX++;
|
||||
if (sinX < presin) {
|
||||
qDebug() << "[WARNING] Tone effect overflowed";
|
||||
dout << "[WARNING] Tone effect overflowed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QtMath>
|
||||
#include <QDebug>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ui/labelslider.h"
|
||||
@@ -22,7 +21,6 @@ VolumeEffect::VolumeEffect(Clip* c) : Effect(c, EFFECT_TYPE_AUDIO, AUDIO_VOLUME_
|
||||
}
|
||||
|
||||
void VolumeEffect::process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int) {
|
||||
// qDebug() << timecode_start << timecode_end;
|
||||
double interval = (timecode_end-timecode_start)/nb_bytes;
|
||||
for (int i=0;i<nb_bytes;i+=2) {
|
||||
double vol_val = qSqrt(volume_val->get_double_value(timecode_start+(interval*i), true)*0.01);
|
||||
|
||||
+8
-7
@@ -16,6 +16,7 @@
|
||||
#include "project/clip.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/effectcontrols.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "effects/video/transformeffect.h"
|
||||
#include "effects/video/inverteffect.h"
|
||||
@@ -92,7 +93,7 @@ Effect* create_effect(int effect_id, Clip* c) {
|
||||
case AUDIO_TONE_EFFECT: return new ToneEffect(c); break;
|
||||
}
|
||||
}
|
||||
qDebug() << "[ERROR] Invalid effect ID";
|
||||
dout << "[ERROR] Invalid effect ID";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -271,14 +272,14 @@ void Effect::load(QXmlStreamReader& stream) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
qDebug() << "[ERROR] Too many fields for effect" << id << "row" << row_count << ". Project might be corrupt. (Got" << field_count << ", expected <" << row->fieldCount()-1 << ")";
|
||||
dout << "[ERROR] Too many fields for effect" << id << "row" << row_count << ". Project might be corrupt. (Got" << field_count << ", expected <" << row->fieldCount()-1 << ")";
|
||||
}
|
||||
field_count++;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
qDebug() << "[ERROR] Too many rows for effect" << id << ". Project might be corrupt. (Got" << row_count << ", expected <" << rows.size()-1 << ")";
|
||||
dout << "[ERROR] Too many rows for effect" << id << ". Project might be corrupt. (Got" << row_count << ", expected <" << rows.size()-1 << ")";
|
||||
}
|
||||
row_count++;
|
||||
}
|
||||
@@ -313,11 +314,11 @@ void Effect::save(QXmlStreamWriter& stream) {
|
||||
|
||||
void Effect::open() {
|
||||
if (isOpen) {
|
||||
qDebug() << "[WARNING] Tried to open an effect that was already open";
|
||||
dout << "[WARNING] Tried to open an effect that was already open";
|
||||
close();
|
||||
}
|
||||
if (QOpenGLContext::currentContext() == NULL) {
|
||||
qDebug() << "[WARNING] No current context to create a shader program for - will retry next repaint";
|
||||
dout << "[WARNING] No current context to create a shader program for - will retry next repaint";
|
||||
} else {
|
||||
glslProgram = new QOpenGLShaderProgram();
|
||||
if (!vertPath.isEmpty()) glslProgram->addShaderFromSourceFile(QOpenGLShader::Vertex, vertPath);
|
||||
@@ -329,7 +330,7 @@ void Effect::open() {
|
||||
|
||||
void Effect::close() {
|
||||
if (!isOpen) {
|
||||
qDebug() << "[WARNING] Tried to close an effect that was already closed";
|
||||
dout << "[WARNING] Tried to close an effect that was already closed";
|
||||
} else {
|
||||
delete glslProgram;
|
||||
}
|
||||
@@ -340,7 +341,7 @@ void Effect::close() {
|
||||
void Effect::startEffect() {
|
||||
if (!isOpen) {
|
||||
open();
|
||||
qDebug() << "[WARNING] Tried to start a closed effect - opening";
|
||||
dout << "[WARNING] Tried to start a closed effect - opening";
|
||||
}
|
||||
bound = glslProgram->bind();
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "project/clip.h"
|
||||
#include "io/config.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include "debug.h"
|
||||
|
||||
QVector<QString> video_transition_names;
|
||||
QVector<QString> audio_transition_names;
|
||||
@@ -38,6 +37,6 @@ Transition* create_transition(int transition_id, Clip* c) {
|
||||
case AUDIO_LINEAR_FADE_TRANSITION: return new LinearFadeTransition();
|
||||
}
|
||||
}
|
||||
qDebug() << "[ERROR] Invalid transition ID";
|
||||
dout << "[ERROR] Invalid transition ID";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <QLabel>
|
||||
#include <QtMath>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QDebug>
|
||||
|
||||
#include "ui/labelslider.h"
|
||||
#include "ui/collapsiblewidget.h"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <QColorDialog>
|
||||
#include <QFontDatabase>
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui/labelslider.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "transformeffect.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
@@ -16,6 +15,7 @@
|
||||
#include "ui/labelslider.h"
|
||||
#include "ui/comboboxex.h"
|
||||
#include "panels/project.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define BLEND_MODE_NORMAL 0
|
||||
#define BLEND_MODE_SCREEN 1
|
||||
@@ -143,7 +143,7 @@ void TransformEffect::process_coords(double timecode, GLTextureCoords& coords) {
|
||||
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
break;
|
||||
default:
|
||||
qDebug() << "[ERROR] Invalid blend mode. This is a bug - please contact developers";
|
||||
dout << "[ERROR] Invalid blend mode. This is a bug - please contact developers";
|
||||
}
|
||||
|
||||
// opacity
|
||||
|
||||
Reference in New Issue
Block a user