'use strict';

 // Assign the audio codec to use
module.exports = function(command, file, options, metadata, details) {
  return new Promise((resolve, reject) => {

    command.audioCodec(options.audio.codec);

    return resolve();
  });
};

@@ -8,17 +8,16 @@
 rict';%0A%0A
- 
 // Assig
@@ -165,50 +165,612 @@
     
-command.audioCodec(options.audio.codec);%0A%0A
+// Are we copying source?%0A    if ( options.audio.codec === 'copy' ) %7B%0A%0A      // Get the codec data from the audio stream%0A      options.audio.codec = command.streams.audio%5B0%5D.codec_name;%0A    %7D%0A%0A    // Get a list of the available codecs%0A    command.getAvailableCodecs((err, codecs) =%3E %7B%0A%0A      // Check we have this one and can encode it%0A      if ( ! codecs%5Boptions.audio.codec%5D %7C%7C ! codecs%5Boptions.audio.codec%5D.canEncode ) %7B%0A        return reject('Codec %22' + options.audio.codec + '%22 is not available for encoding.');%0A      %7D%0A%0A      // Assign audio codec%0A      command.audioCodec(options.audio.codec);%0A%0A  
     
@@ -787,16 +787,24 @@
 olve();%0A
+    %7D);%0A
   %7D);%0A%7D;

Update engine to check for valid audio codec