summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-04-01 19:52:49 +0000
committersr55 <[email protected]>2015-04-01 19:52:49 +0000
commitc1fefaee7a3c8d4a35d1224ba19d7a7915e2e075 (patch)
treec64cf3e972ef383e7ecbaee79acdbdbe66babd71 /win/CS/HandBrake.ApplicationServices/Services
parent67f6b82d9c52e005e5df02c31807a4899b3e2629 (diff)
WinGui: Enable the Auto Passthru behaviours though the JSON api copymask
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7032 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
index 2f99e37a9..670424127 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
@@ -23,6 +23,7 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
+ using HandBrake.ApplicationServices.Utilities;
using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack;
using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitle;
@@ -296,15 +297,19 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
{
Audio audio = new Audio();
- // TODO Handled on the front-end ? Maybe we can offload logic.
- //if (!string.IsNullOrEmpty(job.AudioEncoderFallback))
- //{
- // HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.AudioEncoderFallback);
- // Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.AudioEncoderFallback);
- // audio.FallbackEncoder = audioEncoder.Id;
- //}
-
- audio.CopyMask = (int)NativeConstants.HB_ACODEC_ANY;
+ int copyMask = 0;
+ if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMask = (int)NativeConstants.HB_ACODEC_AAC_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_AC3_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMask |= (int)NativeConstants.HB_ACODEC_DCA_HD_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMask |= (int)NativeConstants.HB_ACODEC_DCA_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_EAC3_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMask |= (int)NativeConstants.HB_ACODEC_FLAC_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_MP3_PASS;
+ if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMask |= (int)NativeConstants.HB_ACODEC_TRUEHD_PASS;
+
+ audio.CopyMask = copyMask;
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
+ audio.FallbackEncoder = audioEncoder.Id;
audio.AudioList = new List<AudioList>();
foreach (AudioTrack item in job.AudioTracks)