summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-20 22:16:36 +0000
committersr55 <[email protected]>2015-01-20 22:16:36 +0000
commitab2fbd0d331ac4be8b3a78b977d328f91dcbfedf (patch)
tree751fa13f6e2d9565a6c929fd3598f6838939486d
parent26e7efb9e7ab8a319a4912ae2287b69f02251006 (diff)
WinGui: Fix audio track selection on JSON LibHB API.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6782 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs6
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs3
2 files changed, 4 insertions, 5 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
index 37d9499cd..0f2fa8688 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
@@ -76,13 +76,13 @@ namespace HandBrake.ApplicationServices.Utilities
Drc = track.DRC,
Gain = track.Gain,
Encoder = Converters.GetCliAudioEncoder(track.Encoder),
- InputNumber = track.Track.HasValue ? track.Track.Value : 0,
+ InputNumber = track.Track.HasValue ? track.Track.Value - 1 : 0, // It's 0 based index
Mixdown = Converters.GetCliMixDown(track.MixDown),
SampleRateRaw = GetSampleRateRaw(track.SampleRate),
EncodeRateType = AudioEncodeRateType.Bitrate,
Name = track.TrackName,
- IsPassthru = track.IsPassthru
- };
+ IsPassthru = track.IsPassthru,
+ };
job.AudioEncodings.Add(newTrack);
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
index 327e5ce9f..2ddc5a6fc 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
@@ -286,7 +286,6 @@ namespace HandBrake.Interop.Json.Factories
audio.CopyMask = (int)NativeConstants.HB_ACODEC_ANY;
audio.AudioList = new List<AudioList>();
- int numTracks = 0;
foreach (AudioEncoding item in job.AudioEncodings)
{
HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(item.Encoder);
@@ -297,7 +296,7 @@ namespace HandBrake.Interop.Json.Factories
AudioList audioTrack = new AudioList
{
- Track = numTracks++,
+ Track = item.InputNumber,
DRC = item.Drc,
Encoder = encoder.Id,
Gain = item.Gain,