Permalink
Browse files

Merge remote-tracking branch 'remotes/origin/MP1-4928V3-Rework-Add_Au…

…dio_delay_for_LAV_Audio' into EXP_MP1-4928V2_and_MP1-4929_merged
  • Loading branch information...
owlsroost committed Jan 10, 2019
2 parents 3f1152c + 1ecb757 commit 16946480c092ab0067cfc515638ca46c220c32d6
Showing with 43 additions and 24 deletions.
  1. +35 −21 mediaportal/Configuration/Sections/Movies.cs
  2. +8 −3 mediaportal/Core/Player/VMR9.cs
@@ -103,7 +103,8 @@ public class Movies : SectionSettings
private MPLabel mpLabelOptionLAV;
private MPCheckBox streamLAVSelectionCheckBox;
private MPCheckBox chbKeepFoldersTogether;
private static bool SubtitleComboMessageDone = false;
private static bool SubtitleComboMessageDone = false;
private MPCheckBox NoAudioResetCheckBox;
internal bool MadVrInUse = false;

//private int
@@ -192,7 +193,9 @@ public override void LoadSettings()
delayVideoTextBox.Value = xmlreader.GetValueAsInt("FFDShow", "audiodelayInterval", 50);
saveNeverRadioButton.Checked = xmlreader.GetValueAsBool("subtitles", "saveNever", true);
saveAskRadioButton.Checked = xmlreader.GetValueAsBool("subtitles", "saveAsk", false);
saveAlwaysRadioButton.Checked = !saveNeverRadioButton.Checked && !saveAskRadioButton.Checked;
saveAlwaysRadioButton.Checked = !saveNeverRadioButton.Checked && !saveAskRadioButton.Checked;

NoAudioResetCheckBox.Checked = xmlreader.GetValueAsBool("audiodelay", "noaudioresetzero", false);

//
// Get font settings
@@ -330,7 +333,8 @@ public override void SaveSettings()
xmlwriter.SetValue("subtitles", "selection", subtitlesSelectionComboBox.SelectedItem);
}
xmlwriter.SetValueAsBool("movieplayer", "audiodefaultlanguage", audioDefaultCheckBox.Checked);
xmlwriter.SetValueAsBool("movieplayer", "streamlavselection", streamLAVSelectionCheckBox.Checked);
xmlwriter.SetValueAsBool("movieplayer", "streamlavselection", streamLAVSelectionCheckBox.Checked);
xmlwriter.SetValueAsBool("audiodelay", "noaudioresetzero", NoAudioResetCheckBox.Checked);
}
}

@@ -380,6 +384,7 @@ private void InitializeComponent()
this.fontDialog = new System.Windows.Forms.FontDialog();
this.tabPage1 = new MediaPortal.UserInterface.Controls.MPTabPage();
this.mpGroupBoxVideoAudioDelay = new MediaPortal.UserInterface.Controls.MPGroupBox();
this.NoAudioResetCheckBox = new MediaPortal.UserInterface.Controls.MPCheckBox();
this.delayVideoTextBox = new System.Windows.Forms.NumericUpDown();
this.mpLabelAVDelayTime = new MediaPortal.UserInterface.Controls.MPLabel();
this.mpLabelAVDelay = new MediaPortal.UserInterface.Controls.MPLabel();
@@ -438,7 +443,7 @@ private void InitializeComponent()
tabPage3.Controls.Add(this.mpGroupBox1);
tabPage3.Location = new System.Drawing.Point(4, 22);
tabPage3.Name = "tabPage3";
tabPage3.Size = new System.Drawing.Size(464, 382);
tabPage3.Size = new System.Drawing.Size(464, 438);
tabPage3.TabIndex = 7;
tabPage3.Text = "Subtitle";
tabPage3.UseVisualStyleBackColor = true;
@@ -661,14 +666,14 @@ private void InitializeComponent()
this.mpLabel4.Name = "mpLabel4";
this.mpLabel4.Size = new System.Drawing.Size(107, 16);
this.mpLabel4.TabIndex = 6;
this.mpLabel4.Text = "Delay interval:";
this.mpLabel4.Text = "Delay interval step:";
//
// mpTabPage2
//
mpTabPage2.Controls.Add(this.mpGroupBox2);
mpTabPage2.Location = new System.Drawing.Point(4, 22);
mpTabPage2.Name = "mpTabPage2";
mpTabPage2.Size = new System.Drawing.Size(464, 382);
mpTabPage2.Size = new System.Drawing.Size(464, 438);
mpTabPage2.TabIndex = 10;
mpTabPage2.Text = "Subtitle (cont)";
mpTabPage2.UseVisualStyleBackColor = true;
@@ -819,7 +824,7 @@ private void InitializeComponent()
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(464, 382);
this.tabPage1.Size = new System.Drawing.Size(464, 438);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "General";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -828,37 +833,44 @@ private void InitializeComponent()
//
this.mpGroupBoxVideoAudioDelay.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.mpGroupBoxVideoAudioDelay.Controls.Add(this.NoAudioResetCheckBox);
this.mpGroupBoxVideoAudioDelay.Controls.Add(this.delayVideoTextBox);
this.mpGroupBoxVideoAudioDelay.Controls.Add(this.mpLabelAVDelayTime);
this.mpGroupBoxVideoAudioDelay.Controls.Add(this.mpLabelAVDelay);
this.mpGroupBoxVideoAudioDelay.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.mpGroupBoxVideoAudioDelay.Location = new System.Drawing.Point(16, 316);
this.mpGroupBoxVideoAudioDelay.Name = "mpGroupBoxVideoAudioDelay";
this.mpGroupBoxVideoAudioDelay.Size = new System.Drawing.Size(432, 49);
this.mpGroupBoxVideoAudioDelay.Size = new System.Drawing.Size(432, 67);
this.mpGroupBoxVideoAudioDelay.TabIndex = 12;
this.mpGroupBoxVideoAudioDelay.TabStop = false;
this.mpGroupBoxVideoAudioDelay.Text = "Video/Audio Delay";
//
// NoAudioResetCheckBox
//
this.NoAudioResetCheckBox.AutoSize = true;
this.NoAudioResetCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.NoAudioResetCheckBox.Location = new System.Drawing.Point(20, 44);
this.NoAudioResetCheckBox.Name = "NoAudioResetCheckBox";
this.NoAudioResetCheckBox.Size = new System.Drawing.Size(276, 17);
this.NoAudioResetCheckBox.TabIndex = 9;
this.NoAudioResetCheckBox.Text = "Remember video/audio delay value for next playback";
this.NoAudioResetCheckBox.UseVisualStyleBackColor = true;
//
// delayVideoTextBox
//
this.delayVideoTextBox.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.delayVideoTextBox.Location = new System.Drawing.Point(148, 18);
this.delayVideoTextBox.Location = new System.Drawing.Point(116, 18);
this.delayVideoTextBox.Maximum = new decimal(new int[] {
500,
0,
0,
0});
this.delayVideoTextBox.Minimum = new decimal(new int[] {
10,
1,
0,
0,
0});
this.delayVideoTextBox.Name = "delayVideoTextBox";
this.delayVideoTextBox.Size = new System.Drawing.Size(52, 20);
this.delayVideoTextBox.Size = new System.Drawing.Size(80, 20);
this.delayVideoTextBox.TabIndex = 16;
this.delayVideoTextBox.Value = new decimal(new int[] {
100,
@@ -868,7 +880,7 @@ private void InitializeComponent()
//
// mpLabelAVDelayTime
//
this.mpLabelAVDelayTime.Location = new System.Drawing.Point(200, 22);
this.mpLabelAVDelayTime.Location = new System.Drawing.Point(195, 22);
this.mpLabelAVDelayTime.Name = "mpLabelAVDelayTime";
this.mpLabelAVDelayTime.Size = new System.Drawing.Size(25, 16);
this.mpLabelAVDelayTime.TabIndex = 15;
@@ -880,7 +892,7 @@ private void InitializeComponent()
this.mpLabelAVDelay.Name = "mpLabelAVDelay";
this.mpLabelAVDelay.Size = new System.Drawing.Size(107, 16);
this.mpLabelAVDelay.TabIndex = 13;
this.mpLabelAVDelay.Text = "Delay interval:";
this.mpLabelAVDelay.Text = "Delay interval step:";
//
// mpGroupBoxComSkip
//
@@ -898,13 +910,14 @@ private void InitializeComponent()
// comSkipCheckBox
//
this.comSkipCheckBox.AutoSize = true;
this.comSkipCheckBox.BackColor = System.Drawing.Color.Transparent;
this.comSkipCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.comSkipCheckBox.Location = new System.Drawing.Point(19, 20);
this.comSkipCheckBox.Name = "comSkipCheckBox";
this.comSkipCheckBox.Size = new System.Drawing.Size(354, 17);
this.comSkipCheckBox.TabIndex = 8;
this.comSkipCheckBox.Text = "Automatically skip commercials for videos with ComSkip data available";
this.comSkipCheckBox.UseVisualStyleBackColor = true;
this.comSkipCheckBox.UseVisualStyleBackColor = false;
//
// groupBox1
//
@@ -1057,15 +1070,15 @@ private void InitializeComponent()
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(472, 408);
this.tabControl1.Size = new System.Drawing.Size(472, 464);
this.tabControl1.TabIndex = 0;
//
// mpTabPage1
//
this.mpTabPage1.Controls.Add(this.mpGroupBox4);
this.mpTabPage1.Location = new System.Drawing.Point(4, 22);
this.mpTabPage1.Name = "mpTabPage1";
this.mpTabPage1.Size = new System.Drawing.Size(464, 382);
this.mpTabPage1.Size = new System.Drawing.Size(464, 438);
this.mpTabPage1.TabIndex = 9;
this.mpTabPage1.Text = "Language";
this.mpTabPage1.UseVisualStyleBackColor = true;
@@ -1179,6 +1192,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.shadowDepthUpDown)).EndInit();
this.tabPage1.ResumeLayout(false);
this.mpGroupBoxVideoAudioDelay.ResumeLayout(false);
this.mpGroupBoxVideoAudioDelay.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.delayVideoTextBox)).EndInit();
this.mpGroupBoxComSkip.ResumeLayout(false);
this.mpGroupBoxComSkip.PerformLayout();
@@ -253,6 +253,7 @@ private enum Vmr9PlayState
protected bool UseEVRMadVRForTV;
protected bool UseMadVideoRenderer3D;
protected bool UseEnhancedVideoRenderer;
protected bool NoAudioResetCheckBox;
protected internal DateTime playbackTimer;
protected internal DateTime PlaneSceneMadvrTimer = new DateTime(0);
protected IVideoWindow videoWinMadVr;
@@ -889,6 +890,7 @@ public bool AddVMR9(IGraphBuilder graphBuilder)
UseEVRMadVRForTV = xmlreader.GetValueAsBool("general", "useEVRMadVRForTV", false);
UseMadVideoRenderer3D = xmlreader.GetValueAsBool("general", "useMadVideoRenderer3D", false);
UseEnhancedVideoRenderer = xmlreader.GetValueAsBool("general", "useEVRenderer", false);
NoAudioResetCheckBox = xmlreader.GetValueAsBool("audiodelay", "noaudioresetzero", false);
}
Log.Debug("VMR9: addvmr9 - thread : {0}", Thread.CurrentThread.Name);
if (!_useVmr9)
@@ -1787,9 +1789,12 @@ public int StartMediaCtrl(IMediaControl mediaCtrl)
DirectShowUtil.FindFilterByClassID(_graphBuilder, ClassId.LAVAudio, out baseFilterLavAudio);
if (baseFilterLavAudio != null)
{
ILAVAudioSettings asett = baseFilterLavAudio as ILAVAudioSettings;
asett?.SetAudioDelay(true, 0);
DirectShowUtil.ReleaseComObject(baseFilterLavAudio);
if (!NoAudioResetCheckBox)
{
ILAVAudioSettings asett = baseFilterLavAudio as ILAVAudioSettings;
asett?.SetAudioDelay(true, 0);
DirectShowUtil.ReleaseComObject(baseFilterLavAudio);
}
}
}
}

0 comments on commit 1694648

Please sign in to comment.