mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
Add mpv log setting
Default if false (off)
This commit is contained in:
parent
f143b8ff4c
commit
5ce4a1ffc3
@ -3,7 +3,7 @@
|
|||||||
3.5.18 (xth November 2020) BETA
|
3.5.18 (xth November 2020) BETA
|
||||||
* NEW:
|
* NEW:
|
||||||
* Add "Measurement converter" - thx OmrSi
|
* Add "Measurement converter" - thx OmrSi
|
||||||
* Add waveform multi- track support - thx OmrSi
|
* Add waveform multi-audio-track support - thx OmrSi
|
||||||
* Add import/export of shortcuts
|
* Add import/export of shortcuts
|
||||||
* Add "Matroska chapter support" - thx OmrSi
|
* Add "Matroska chapter support" - thx OmrSi
|
||||||
* Add subtitle format XMP - thx Tore
|
* Add subtitle format XMP - thx Tore
|
||||||
@ -30,6 +30,7 @@
|
|||||||
* Allow for .mpg/.mpeg transport stream file extension in "Batch convert"
|
* Allow for .mpg/.mpeg transport stream file extension in "Batch convert"
|
||||||
* Add some more EBU STL validation - thx Valentina
|
* Add some more EBU STL validation - thx Valentina
|
||||||
* Improve Korean auto detect in PAC - thx andrewburnheimer
|
* Improve Korean auto detect in PAC - thx andrewburnheimer
|
||||||
|
* Add MpvLogging setting
|
||||||
* FIXED:
|
* FIXED:
|
||||||
* Fix crash in export image with font tag - thx Jake
|
* Fix crash in export image with font tag - thx Jake
|
||||||
* Fix batch convert of Blu-ray sup file to VobSub - thx John
|
* Fix batch convert of Blu-ray sup file to VobSub - thx John
|
||||||
|
@ -1115,6 +1115,7 @@ $HorzAlign = Center
|
|||||||
public string MpvVideoOutputWindows { get; set; }
|
public string MpvVideoOutputWindows { get; set; }
|
||||||
public string MpvVideoOutputLinux { get; set; }
|
public string MpvVideoOutputLinux { get; set; }
|
||||||
public string MpvExtraOption { get; set; }
|
public string MpvExtraOption { get; set; }
|
||||||
|
public bool MpvLogging { get; set; }
|
||||||
public bool MpvHandlesPreviewText { get; set; }
|
public bool MpvHandlesPreviewText { get; set; }
|
||||||
public string MpcHcLocation { get; set; }
|
public string MpcHcLocation { get; set; }
|
||||||
public string MkvMergeLocation { get; set; }
|
public string MkvMergeLocation { get; set; }
|
||||||
@ -3302,6 +3303,12 @@ $HorzAlign = Center
|
|||||||
settings.General.MpvExtraOption = subNode.InnerText.Trim();
|
settings.General.MpvExtraOption = subNode.InnerText.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subNode = node.SelectSingleNode("MpvLogging");
|
||||||
|
if (subNode != null)
|
||||||
|
{
|
||||||
|
settings.General.MpvLogging = Convert.ToBoolean(subNode.InnerText.Trim());
|
||||||
|
}
|
||||||
|
|
||||||
subNode = node.SelectSingleNode("MpvHandlesPreviewText");
|
subNode = node.SelectSingleNode("MpvHandlesPreviewText");
|
||||||
if (subNode != null)
|
if (subNode != null)
|
||||||
{
|
{
|
||||||
@ -7712,6 +7719,7 @@ $HorzAlign = Center
|
|||||||
textWriter.WriteElementString("MpvVideoOutputWindows", settings.General.MpvVideoOutputWindows);
|
textWriter.WriteElementString("MpvVideoOutputWindows", settings.General.MpvVideoOutputWindows);
|
||||||
textWriter.WriteElementString("MpvVideoOutputLinux", settings.General.MpvVideoOutputLinux);
|
textWriter.WriteElementString("MpvVideoOutputLinux", settings.General.MpvVideoOutputLinux);
|
||||||
textWriter.WriteElementString("MpvExtraOption", settings.General.MpvExtraOption);
|
textWriter.WriteElementString("MpvExtraOption", settings.General.MpvExtraOption);
|
||||||
|
textWriter.WriteElementString("MpvLogging", settings.General.MpvLogging.ToString(CultureInfo.InvariantCulture));
|
||||||
textWriter.WriteElementString("MpvHandlesPreviewText", settings.General.MpvHandlesPreviewText.ToString(CultureInfo.InvariantCulture));
|
textWriter.WriteElementString("MpvHandlesPreviewText", settings.General.MpvHandlesPreviewText.ToString(CultureInfo.InvariantCulture));
|
||||||
textWriter.WriteElementString("MpcHcLocation", settings.General.MpcHcLocation);
|
textWriter.WriteElementString("MpcHcLocation", settings.General.MpcHcLocation);
|
||||||
textWriter.WriteElementString("MkvMergeLocation", settings.General.MkvMergeLocation);
|
textWriter.WriteElementString("MkvMergeLocation", settings.General.MkvMergeLocation);
|
||||||
|
@ -64,7 +64,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
|||||||
private IntPtr _mpvHandle;
|
private IntPtr _mpvHandle;
|
||||||
private Timer _videoLoadedTimer;
|
private Timer _videoLoadedTimer;
|
||||||
private double? _pausePosition; // Hack to hold precise seeking when paused
|
private double? _pausePosition; // Hack to hold precise seeking when paused
|
||||||
private string _secondSubtitleFileName;
|
private string _secondSubtitleFileName;
|
||||||
|
|
||||||
public override event EventHandler OnVideoLoaded;
|
public override event EventHandler OnVideoLoaded;
|
||||||
public override event EventHandler OnVideoEnded;
|
public override event EventHandler OnVideoEnded;
|
||||||
@ -359,9 +359,15 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
|||||||
{
|
{
|
||||||
var lpBuffer = IntPtr.Zero;
|
var lpBuffer = IntPtr.Zero;
|
||||||
_mpvGetPropertyString(_mpvHandle, GetUtf8Bytes("aid"), MpvFormatString, ref lpBuffer);
|
_mpvGetPropertyString(_mpvHandle, GetUtf8Bytes("aid"), MpvFormatString, ref lpBuffer);
|
||||||
int id = int.Parse(Marshal.PtrToStringAnsi(lpBuffer));
|
var numberString = Marshal.PtrToStringAnsi(lpBuffer);
|
||||||
int idx = _audioTrackIds.FindIndex(x => x.Key == id);
|
if (string.IsNullOrEmpty(numberString))
|
||||||
int number = AudioTracks.Count > 1 && idx != -1 ? idx : 0;
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = int.Parse(numberString);
|
||||||
|
var idx = _audioTrackIds.FindIndex(x => x.Key == id);
|
||||||
|
var number = AudioTracks.Count > 1 && idx != -1 ? idx : 0;
|
||||||
_mpvFree(lpBuffer);
|
_mpvFree(lpBuffer);
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
@ -504,8 +510,11 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
|||||||
}
|
}
|
||||||
_mpvHandle = _mpvCreate.Invoke();
|
_mpvHandle = _mpvCreate.Invoke();
|
||||||
|
|
||||||
//var logFileName = Path.Combine(Configuration.DataDirectory, "mpv-log-" + Guid.NewGuid() + ".txt");
|
if (Configuration.Settings.General.MpvLogging)
|
||||||
//_mpvSetOptionString(_mpvHandle, GetUtf8Bytes("log-file"), GetUtf8Bytes(logFileName));
|
{
|
||||||
|
var logFileName = Path.Combine(Configuration.DataDirectory, "mpv-log-" + Guid.NewGuid() + ".txt");
|
||||||
|
_mpvSetOptionString(_mpvHandle, GetUtf8Bytes("log-file"), GetUtf8Bytes(logFileName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!Directory.Exists(videoFileName))
|
else if (!Directory.Exists(videoFileName))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user