I have created a function, let's call it function1, this function use a while loop to read a video with Opencv my code is very long so I add an example to explain my problem. When I call this function 2 times in the main it's stops when she finish the first call and don't execute the second call I can't figure out why. How to fix the problem and call the function 2 times.
void function1(param1, param2)
{
char key = 'a';
while (key != 27)
{
cap >> frameFromVideo;
}
}
int main(int argc, char* argv[])
{
function1(param1, param2);
function1(param1, param2)
std::system("pause");
return 0;
}