footageproperties: fixed bug that failed to update image sequence end time

This commit is contained in:
itsmattkc
2020-03-15 14:28:26 +11:00
parent 02e7c68104
commit a6fb0c7e2b
2 changed files with 6 additions and 3 deletions
@@ -87,7 +87,7 @@ FootagePropertiesDialog::FootagePropertiesDialog(QWidget *parent, Footage *foota
connect(track_list, SIGNAL(currentRowChanged(int)), stacked_widget_, SLOT(setCurrentIndex(int)));
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
buttons->setCenterButtons(true);
layout->addWidget(buttons, row, 0, 1, 2);
@@ -113,10 +113,13 @@ void VideoStreamProperties::Accept(QUndoCommand *parent)
if (IsImageSequence(stream_.get())) {
VideoStreamPtr video_stream = std::static_pointer_cast<VideoStream>(stream_);
if (video_stream->start_time() != imgseq_start_time_->GetValue()) {
int64_t new_dur = imgseq_end_time_->GetValue() - imgseq_start_time_->GetValue();
if (video_stream->start_time() != imgseq_start_time_->GetValue()
|| video_stream->duration() != new_dur) {
new ImageSequenceChangeCommand(video_stream,
imgseq_start_time_->GetValue(),
imgseq_end_time_->GetValue() - imgseq_start_time_->GetValue(),
new_dur,
parent);
}
}