Skip to content

Commit

Permalink
set search path explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
jkriege2 committed Dec 5, 2016
1 parent 921da18 commit eb98d90
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion SlitScanGenerator/ffmpeg_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ bool readFFMPEGAsImageStack(cimg_library::CImg<uint8_t> &video, const std::strin
if (frameCallback) {
canceled=frameCallback(0, nb_frames);
}
int ifc=0;

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

// Did we get a video frame?
if(frameFinished) {
ifc++;
// add frame to CImg
if(i%everyNthFrame==0) {
// Convert the image from its native format to RGB
Expand All @@ -138,7 +140,7 @@ bool readFFMPEGAsImageStack(cimg_library::CImg<uint8_t> &video, const std::strin
frame.resize(pCodecCtx->width/xyscale, pCodecCtx->height/xyscale,1,3);
video.append(frame, 'z');
if (frameCallback) {
if (frameCallback((nb_frames>0)?i:video.depth(), nb_frames)) {
if (frameCallback((nb_frames>0)?ifc:video.depth(), nb_frames)) {
canceled=true;
}
}
Expand Down
8 changes: 8 additions & 0 deletions SlitScanGenerator/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#include "mainwindow.h"
#include <QApplication>
#include <QStringList>

int main(int argc, char *argv[])
{
QStringList paths=QCoreApplication::libraryPaths();
paths.prepend("./");
paths.prepend("./plugins/");
QCoreApplication::setLibraryPaths(paths);
QApplication a(argc, argv);
paths.prepend(QCoreApplication::applicationDirPath());
paths.prepend(QCoreApplication::applicationDirPath()+"/plugins/");
QCoreApplication::setLibraryPaths(paths);
MainWindow w;
w.show();

Expand Down
2 changes: 1 addition & 1 deletion SlitScanGenerator/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>SlitScanGenerator</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout">
Expand Down

0 comments on commit eb98d90

Please sign in to comment.