/// ------------------------------------------------------------------------------------ private void DoConversion(object commandLine) { var exePath = FFmpegDownloadHelper.FullPathToFFmpegForSayMoreExe; _conversionOutput = new StringBuilder(exePath); _conversionOutput.Append(commandLine); try { // ffmpeg always seems to write the output to standarderror. // I don't understand why and that's wrong, but we'll deal with it. _process = ExternalProcess.StartProcessToMonitor(exePath, commandLine as string, HandleProcessDataReceived, HandleProcessDataReceived, null); } catch (Exception e) { ErrorReport.ReportNonFatalException(e); return; } try { _process.PriorityClass = ProcessPriorityClass.BelowNormal; } catch (InvalidOperationException) { // process probably already exited } _process.WaitForExit(); if (_conversionReportingAction != null) { _conversionReportingAction(TimeSpan.FromSeconds(int.MaxValue), null); } }
/// ------------------------------------------------------------------------------------ public static ExternalProcess StartProcessToMonitor(IEnumerable <string> args, DataReceivedEventHandler outputDataHandler, DataReceivedEventHandler errorDataHandler) { return(ExternalProcess.StartProcessToMonitor(MPlayerPath, args, outputDataHandler, errorDataHandler, LocalizationManager.GetString( "CommonToMultipleViews.MediaPlayer.UnableToStartMplayerProcessMsg", "Unable to start mplayer."))); }