Skip to content

Commit eb98d90

Browse files
committed
set search path explicitly
1 parent 921da18 commit eb98d90

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

SlitScanGenerator/ffmpeg_tools.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ bool readFFMPEGAsImageStack(cimg_library::CImg<uint8_t> &video, const std::strin
112112
if (frameCallback) {
113113
canceled=frameCallback(0, nb_frames);
114114
}
115+
int ifc=0;
115116

116117
while(!canceled && av_read_frame(pFormatCtx, &packet)>=0) {
117118
// Is this a packet from the video stream?
@@ -121,6 +122,7 @@ bool readFFMPEGAsImageStack(cimg_library::CImg<uint8_t> &video, const std::strin
121122

122123
// Did we get a video frame?
123124
if(frameFinished) {
125+
ifc++;
124126
// add frame to CImg
125127
if(i%everyNthFrame==0) {
126128
// Convert the image from its native format to RGB
@@ -138,7 +140,7 @@ bool readFFMPEGAsImageStack(cimg_library::CImg<uint8_t> &video, const std::strin
138140
frame.resize(pCodecCtx->width/xyscale, pCodecCtx->height/xyscale,1,3);
139141
video.append(frame, 'z');
140142
if (frameCallback) {
141-
if (frameCallback((nb_frames>0)?i:video.depth(), nb_frames)) {
143+
if (frameCallback((nb_frames>0)?ifc:video.depth(), nb_frames)) {
142144
canceled=true;
143145
}
144146
}

SlitScanGenerator/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
#include "mainwindow.h"
22
#include <QApplication>
3+
#include <QStringList>
34

45
int main(int argc, char *argv[])
56
{
7+
QStringList paths=QCoreApplication::libraryPaths();
8+
paths.prepend("./");
9+
paths.prepend("./plugins/");
10+
QCoreApplication::setLibraryPaths(paths);
611
QApplication a(argc, argv);
12+
paths.prepend(QCoreApplication::applicationDirPath());
13+
paths.prepend(QCoreApplication::applicationDirPath()+"/plugins/");
14+
QCoreApplication::setLibraryPaths(paths);
715
MainWindow w;
816
w.show();
917

SlitScanGenerator/mainwindow.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>MainWindow</string>
14+
<string>SlitScanGenerator</string>
1515
</property>
1616
<widget class="QWidget" name="centralWidget">
1717
<layout class="QGridLayout" name="gridLayout">

0 commit comments

Comments
 (0)