Skip to content

Commit 124cfa9

Browse files
author
RandomEngy
committed
Added inline warning for DTS audio in MP4 container.
1 parent d8bca6d commit 124cfa9

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

VidCoder/Controls/InlineWarning.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public InlineWarning()
2525
}
2626

2727
public static readonly DependencyProperty WarningTextProperty = DependencyProperty.Register(
28-
"Number",
28+
"WarningText",
2929
typeof(string),
3030
typeof(InlineWarning),
3131
new PropertyMetadata(new PropertyChangedCallback(OnWarningTextChanged)));

VidCoder/View/Panels/AudioPanel.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
<controls:InlineWarning
190190
Visibility="{Binding PassthroughWarningVisible, Converter={StaticResource VisibilityConverter}}"
191191
Margin="0,10,0,0" HorizontalAlignment="Left"
192-
WarningText="Passthrough only works for AAC, AC3, MP3, DTS and DTS-HD sources. One or more audio tracks were dropped." />
192+
WarningText="{Binding PassthroughWarningText}" />
193193
</StackPanel>
194194
</Grid>
195195
</UserControl>

VidCoder/ViewModel/Panels/AudioPanelViewModel.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace VidCoder.ViewModel
1212
{
1313
public class AudioPanelViewModel : PanelViewModel
1414
{
15+
private string passthroughWarningText;
1516
private bool passthroughWarningVisible;
1617

1718
private ObservableCollection<AudioEncodingViewModel> audioEncodings;
@@ -51,6 +52,20 @@ public bool HasAudioTracks
5152
}
5253
}
5354

55+
public string PassthroughWarningText
56+
{
57+
get
58+
{
59+
return this.passthroughWarningText;
60+
}
61+
62+
set
63+
{
64+
this.passthroughWarningText = value;
65+
this.NotifyPropertyChanged("PassthroughWarningText");
66+
}
67+
}
68+
5469
public bool PassthroughWarningVisible
5570
{
5671
get
@@ -189,11 +204,18 @@ public AudioOutputPreview GetAudioPreview(AudioTrack inputTrack, AudioEncodingVi
189204

190205
if (encoder == AudioEncoder.Passthrough && !Utilities.CanPassthrough(inputTrack.Codec))
191206
{
207+
this.PassthroughWarningText = "Passthrough only works for AAC, AC3, MP3, DTS and DTS-HD sources. One or more audio tracks were dropped.";
192208
this.PassthroughWarningVisible = true;
193209

194210
return null;
195211
}
196212

213+
if (encoder == AudioEncoder.Passthrough && (inputTrack.Codec == AudioCodec.Dts || inputTrack.Codec == AudioCodec.DtsHD) && this.Profile.OutputFormat == OutputFormat.Mp4)
214+
{
215+
this.PassthroughWarningText = "Few players support playback of DTS audio in MP4 containers. MKV is recommended for DTS audio.";
216+
this.PassthroughWarningVisible = true;
217+
}
218+
197219
return outputPreviewTrack;
198220
}
199221

0 commit comments

Comments
 (0)