From e42c90618b0e0eea85dea3f16cbad2ea1aa47e6e Mon Sep 17 00:00:00 2001 From: Elian Dib <elian.dib@inria.fr> Date: Mon, 12 Aug 2019 15:39:47 +0200 Subject: [PATCH] Simplified piping, removed unnecessary fallback option --- codec.m | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/codec.m b/codec.m index 6f5d683..8c18454 100644 --- a/codec.m +++ b/codec.m @@ -78,7 +78,7 @@ LogFileEnc = fullfile(LogFolder,[LogName,'_enc.rtf']); LogFileDec = fullfile(LogFolder,[LogName,'_dec.rtf']); %% Execute command -HEVCArgList = paramToArgList(HEVCParams); +HEVCArgList = paramToArgList(HEVCParams); extraHEVCArgList = paramToArgList(extraHEVCParams); % Prompt in terminal and write in log file @@ -88,28 +88,20 @@ elseif isunix redirect = @(logfile) ['| tee "' ,logfile, '"']; end -% Execute command if encode - command = ['"' TApp,'" ',HEVCArgList,' ',extraHEVCArgList,' ',redirect(LogFileEnc)]; + redirectLog = redirect(LogFileEnc); elseif decode - command = ['"' TApp,'" ',HEVCArgList, redirect(LogFileDec)]; + redirectLog = redirect(LogFileDec); end +command = ['"' TApp,'" ',HEVCArgList,' ',extraHEVCArgList,' ',redirectLog]; + +% Execute command disp(command) status = system(command); -% Try without extra HEVC parameters if HEVC error if status - if encode - command = ['"' TApp,'" ',HEVCArgList,' ',redirect(LogFileEnc)]; - end - - disp(command) - status = system(command); - - if status - error('HEVC Error'); - end + error('HEVC Error'); end % Read compression statistics from log file -- GitLab