Use Glib::usleep for portability

This commit is contained in:
Tim Mayberry 2013-07-20 10:17:18 +10:00
parent d975d84437
commit ccaa29d210

View File

@ -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();
} }