Use Glib::usleep for portability
This commit is contained in:
parent
d975d84437
commit
ccaa29d210
@ -126,7 +126,7 @@ TranscodeFfmpeg::probe ()
|
|||||||
* SystemExec::Terminated is emitted and ffcmd set to NULL */
|
* SystemExec::Terminated is emitted and ffcmd set to NULL */
|
||||||
int timeout = 300; // 1.5 sec
|
int timeout = 300; // 1.5 sec
|
||||||
while (ffcmd && --timeout > 0) {
|
while (ffcmd && --timeout > 0) {
|
||||||
usleep(5000);
|
Glib::usleep(5000);
|
||||||
}
|
}
|
||||||
if (timeout == 0 || ffoutput.empty()) {
|
if (timeout == 0 || ffoutput.empty()) {
|
||||||
return false;
|
return false;
|
||||||
@ -507,7 +507,11 @@ TranscodeFfmpeg::cancel ()
|
|||||||
{
|
{
|
||||||
if (!ffcmd || !ffcmd->is_running()) { return;}
|
if (!ffcmd || !ffcmd->is_running()) { return;}
|
||||||
ffcmd->write_to_stdin("q");
|
ffcmd->write_to_stdin("q");
|
||||||
|
#ifdef WIN32
|
||||||
|
Sleep(1000);
|
||||||
|
#else
|
||||||
sleep (1);
|
sleep (1);
|
||||||
|
#endif
|
||||||
if (ffcmd) {
|
if (ffcmd) {
|
||||||
ffcmd->terminate();
|
ffcmd->terminate();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user