From be75125f2b2ae83cf93bf05004ffdde90100d300 Mon Sep 17 00:00:00 2001 From: Austin Van Blanton Date: Tue, 6 Aug 2013 14:10:45 -0400 Subject: [PATCH] Use path when opening videos --- openbr/plugins/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 7d3aa11..ed46229 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -379,7 +379,8 @@ public: // overload of open that takes an integer, not a string. // So, does this look like an integer? bool is_int = false; - int anInt = input.file.name.toInt(&is_int); + QString fileName = (Globals->path.isEmpty() ? "" : Globals->path + "/") + input.file.name; + int anInt = fileName.toInt(&is_int); if (is_int) { bool rc = video.open(anInt); @@ -395,7 +396,7 @@ public: } else { // Yes, we should specify absolute path: // http://stackoverflow.com/questions/9396459/loading-a-video-in-opencv-in-python - video.open(QFileInfo(input.file.name).absoluteFilePath().toStdString()); + video.open(QFileInfo(fileName).absoluteFilePath().toStdString()); } return video.isOpened(); -- libgit2 0.21.4