vtl: wait for output from ffprobe
fix code-ordering bug that sneaked in when re-factoring the parser.
This commit is contained in:
parent
1ca430babd
commit
21a4ce62dc
@ -114,8 +114,20 @@ TranscodeFfmpeg::probe ()
|
|||||||
ffexit();
|
ffexit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wait for ffprobe process to exit */
|
||||||
ffcmd->wait();
|
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 */
|
/* parse */
|
||||||
|
|
||||||
std::vector<std::vector<std::string> > lines;
|
std::vector<std::vector<std::string> > lines;
|
||||||
@ -231,11 +243,6 @@ TranscodeFfmpeg::probe ()
|
|||||||
}
|
}
|
||||||
/* end parse */
|
/* end parse */
|
||||||
|
|
||||||
|
|
||||||
int timeout = 500;
|
|
||||||
while (ffcmd && --timeout) usleep (1000); // wait until 'ffprobe' terminated.
|
|
||||||
if (timeout == 0) return false;
|
|
||||||
|
|
||||||
#if 0 /* DEBUG */
|
#if 0 /* DEBUG */
|
||||||
printf("FPS: %f\n", m_fps);
|
printf("FPS: %f\n", m_fps);
|
||||||
printf("Duration: %lu frames\n",(unsigned long)m_duration);
|
printf("Duration: %lu frames\n",(unsigned long)m_duration);
|
||||||
|
Loading…
Reference in New Issue
Block a user