mostly finished speed
This commit is contained in:
+4
-6
@@ -54,7 +54,7 @@ Clip* Clip::copy(Sequence* s) {
|
||||
copy->media_type = media_type;
|
||||
copy->media_stream = media_stream;
|
||||
copy->autoscale = autoscale;
|
||||
copy->frame_rate = frame_rate;
|
||||
copy->speed = speed;
|
||||
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
copy->effects.append(effects.at(i)->copy(copy));
|
||||
@@ -63,6 +63,8 @@ Clip* Clip::copy(Sequence* s) {
|
||||
if (opening_transition != NULL) copy->opening_transition = opening_transition->copy();
|
||||
if (closing_transition != NULL) copy->closing_transition = closing_transition->copy();
|
||||
|
||||
copy->recalculateMaxLength();
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -173,11 +175,7 @@ long Clip::getLength() {
|
||||
void Clip::recalculateMaxLength() {
|
||||
double fr = this->sequence->frame_rate;
|
||||
|
||||
if (track < 0) {
|
||||
fr *= (getMediaFrameRate()/frame_rate);
|
||||
} else {
|
||||
fr /= frame_rate;
|
||||
}
|
||||
fr /= speed;
|
||||
|
||||
switch (media_type) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
|
||||
+3
-4
@@ -71,7 +71,7 @@ struct Clip
|
||||
int media_stream;
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
double frame_rate;
|
||||
double speed;
|
||||
long calculated_length;
|
||||
|
||||
// other variables (should be "duplicated" in copy())
|
||||
@@ -110,15 +110,14 @@ struct Clip
|
||||
AVFilterContext* buffersink_ctx;
|
||||
AVFilterContext* buffersrc_ctx;
|
||||
|
||||
// video playback variables
|
||||
// SwsContext* sws_ctx;
|
||||
// video playback variables
|
||||
QOpenGLFramebufferObject** fbo;
|
||||
QOpenGLTexture* texture;
|
||||
long texture_frame;
|
||||
bool autoscale;
|
||||
|
||||
// audio playback variables
|
||||
// SwrContext* swr_ctx;
|
||||
SwrContext* swr_ctx;
|
||||
int frame_sample_index;
|
||||
int audio_buffer_write;
|
||||
bool audio_reset;
|
||||
|
||||
Reference in New Issue
Block a user