importtool: implemented auto-parameter detection from image streams too

This commit is contained in:
itsmattkc
2020-02-25 14:59:54 +11:00
parent 8d7b94658b
commit ab19e445bd
+14 -5
View File
@@ -238,13 +238,22 @@ void TimelineWidget::ImportTool::DragDrop(TimelineViewMouseEvent *event)
foreach (Footage* f, dragged_footage_) {
foreach (StreamPtr s, f->streams()) {
if (!found_video_params && s->type() == Stream::kVideo) {
if (!found_video_params) {
VideoStream* vs = static_cast<VideoStream*>(s.get());
if (s->type() == Stream::kVideo) {
// If this is a video stream, use these parameters
VideoStream* vs = static_cast<VideoStream*>(s.get());
if (vs->frame_rate() != 0) {
new_sequence->set_video_params(VideoParams(vs->width(), vs->height(), vs->frame_rate().flipped()));
found_video_params = true;
if (vs->frame_rate() != 0) {
new_sequence->set_video_params(VideoParams(vs->width(), vs->height(), vs->frame_rate().flipped()));
found_video_params = true;
}
} else if (s->type() == Stream::kImage) {
// If this is an image stream, we'll use it's resolution but won't set `found_video_params` in case
// something with a frame rate comes along which we'll prioritize
ImageStream* is = static_cast<ImageStream*>(s.get());
new_sequence->set_video_params(VideoParams(is->width(), is->height(), new_sequence->video_params().time_base()));
}
} else if (!found_audio_params && s->type() == Stream::kAudio) {