13
0

vtl: wait for output from ffprobe

fix code-ordering bug that sneaked in when re-factoring the parser.
This commit is contained in:
Robin Gareus 2013-06-11 02:58:10 +02:00
parent 1ca430babd
commit 21a4ce62dc

View File

@ -114,8 +114,20 @@ TranscodeFfmpeg::probe ()
ffexit();
return false;
}
/* wait for ffprobe process to exit */
ffcmd->wait();
/* wait for interposer thread to copy all data.
* SystemExec::Terminated is emitted and ffcmd set to NULL */
int timeout = 300; // 1.5 sec
while (ffcmd && --timeout > 0) {
usleep(5000);
}
if (timeout == 0 || ffoutput.empty()) {
return false;
}
/* parse */
std::vector<std::vector<std::string> > lines;
@ -231,11 +243,6 @@ TranscodeFfmpeg::probe ()
}
/* end parse */
int timeout = 500;
while (ffcmd && --timeout) usleep (1000); // wait until 'ffprobe' terminated.
if (timeout == 0) return false;
#if 0 /* DEBUG */
printf("FPS: %f\n", m_fps);
printf("Duration: %lu frames\n",(unsigned long)m_duration);