Commit be75125f2b2ae83cf93bf05004ffdde90100d300

Authored by Austin Van Blanton
1 parent 8a289d37

Use path when opening videos

Showing 1 changed file with 3 additions and 2 deletions
openbr/plugins/stream.cpp
... ... @@ -379,7 +379,8 @@ public:
379 379 // overload of open that takes an integer, not a string.
380 380 // So, does this look like an integer?
381 381 bool is_int = false;
382   - int anInt = input.file.name.toInt(&is_int);
  382 + QString fileName = (Globals->path.isEmpty() ? "" : Globals->path + "/") + input.file.name;
  383 + int anInt = fileName.toInt(&is_int);
383 384 if (is_int)
384 385 {
385 386 bool rc = video.open(anInt);
... ... @@ -395,7 +396,7 @@ public:
395 396 } else {
396 397 // Yes, we should specify absolute path:
397 398 // http://stackoverflow.com/questions/9396459/loading-a-video-in-opencv-in-python
398   - video.open(QFileInfo(input.file.name).absoluteFilePath().toStdString());
  399 + video.open(QFileInfo(fileName).absoluteFilePath().toStdString());
399 400 }
400 401  
401 402 return video.isOpened();
... ...