diff --git a/codec.m b/codec.m
index 6f5d683ca3cfd356e5a8634434e9fe21d8d66e1e..8c18454901dd9baae116b3bea932f1168623abff 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