fixed #98
This commit is contained in:
+12
-2
@@ -67,7 +67,12 @@ void PreviewGenerator::run() {
|
||||
if (read_ret != AVERROR_EOF) qDebug() << "[ERROR] Failed to read packet for preview generation";
|
||||
break;
|
||||
} else if (codec_ctx[packet.stream_index] != NULL) {
|
||||
avcodec_send_packet(codec_ctx[packet.stream_index], &packet);
|
||||
int send_ret = avcodec_send_packet(codec_ctx[packet.stream_index], &packet);
|
||||
if (send_ret < 0) {
|
||||
qDebug() << "[ERROR] Failed to send packet for preview generation - aborting";
|
||||
end_of_file = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!end_of_file) {
|
||||
@@ -103,6 +108,9 @@ void PreviewGenerator::run() {
|
||||
s->preview_lock.unlock();
|
||||
|
||||
sws_freeContext(sws_ctx);
|
||||
|
||||
avcodec_close(codec_ctx[packet.stream_index]);
|
||||
codec_ctx[packet.stream_index] = NULL;
|
||||
} else if (fmt_ctx->streams[packet.stream_index]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
int interval = qFloor((temp_frame->sample_rate/WAVEFORM_RESOLUTION)/4)*4;
|
||||
|
||||
@@ -175,7 +183,9 @@ void PreviewGenerator::run() {
|
||||
}
|
||||
av_frame_free(&temp_frame);
|
||||
for (unsigned int i=0;i<fmt_ctx->nb_streams;i++) {
|
||||
avcodec_close(codec_ctx[i]);
|
||||
if (codec_ctx[i] != NULL) {
|
||||
avcodec_close(codec_ctx[i]);
|
||||
}
|
||||
}
|
||||
delete [] codec_ctx;
|
||||
}
|
||||
|
||||
+2
-1
@@ -183,7 +183,8 @@ void Project::delete_selected_media() {
|
||||
Media* m = get_media_from_tree(items.at(i));
|
||||
if (!m->is_sequence && sequence != NULL) {
|
||||
for (int j=0;j<sequence->clip_count();j++) {
|
||||
if (sequence->get_clip(j)->media == m) {
|
||||
Clip* c = sequence->get_clip(j);
|
||||
if (c != NULL && c->media == m) {
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -672,6 +672,8 @@ void TimelineWidget::update_ghosts(QPoint& mouse_pos) {
|
||||
}
|
||||
|
||||
void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
bool alt = (event->modifiers() & Qt::AltModifier);
|
||||
|
||||
panel_timeline->cursor_frame = panel_timeline->getFrameFromScreenPoint(event->pos().x());
|
||||
panel_timeline->cursor_track = getTrackFromScreenPoint(event->pos().y());
|
||||
|
||||
@@ -793,7 +795,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
for (int i=0;i<sequence->clip_count();i++) {
|
||||
Clip* clip = sequence->get_clip(i);
|
||||
if (clip != NULL && clip->track == track) {
|
||||
panel_timeline->split_clip_and_relink(clip, panel_timeline->drag_frame_start, !(event->modifiers() & Qt::AltModifier));
|
||||
panel_timeline->split_clip_and_relink(clip, panel_timeline->drag_frame_start, !alt);
|
||||
repaint = true;
|
||||
}
|
||||
}
|
||||
@@ -828,8 +830,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
!(clip->timeline_in > frame_max && clip->timeline_out > frame_max)) {
|
||||
QVector<Clip*> session_clips;
|
||||
session_clips.append(clip);
|
||||
for (int j=0;j<clip->linked.size();j++) {
|
||||
session_clips.append(sequence->get_clip(clip->linked.at(j)));
|
||||
|
||||
if (!alt) {
|
||||
for (int j=0;j<clip->linked.size();j++) {
|
||||
session_clips.append(sequence->get_clip(clip->linked.at(j)));
|
||||
}
|
||||
}
|
||||
|
||||
for (int j=0;j<session_clips.size();j++) {
|
||||
|
||||
Reference in New Issue
Block a user