Skip to content

Commit f009b0f

Browse files
authored
Fix default sizes on readers without MAX_WIDTH and MAX_HEIGHT settings (#188)
1 parent 7b6eb9c commit f009b0f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/FFmpegReader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,11 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame)
892892
// method will scale it back to timeline size before scaling it smaller again. This needs to be fixed in
893893
// the future.
894894
int max_width = Settings::Instance()->MAX_WIDTH;
895+
if (max_width <= 0)
896+
max_width = info.width;
895897
int max_height = Settings::Instance()->MAX_HEIGHT;
898+
if (max_height <= 0)
899+
max_height = info.height;
896900

897901
Clip* parent = (Clip*) GetClip();
898902
if (parent) {

src/QtImageReader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ std::shared_ptr<Frame> QtImageReader::GetFrame(int64_t requested_frame)
168168
// method will scale it back to timeline size before scaling it smaller again. This needs to be fixed in
169169
// the future.
170170
int max_width = Settings::Instance()->MAX_WIDTH;
171+
if (max_width <= 0)
172+
max_width = info.width;
171173
int max_height = Settings::Instance()->MAX_HEIGHT;
174+
if (max_height <= 0)
175+
max_height = info.height;
172176

173177
Clip* parent = (Clip*) GetClip();
174178
if (parent) {

0 commit comments

Comments
 (0)