mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fix #8025
This commit is contained in:
parent
96a10bb532
commit
230a300db3
@ -22006,7 +22006,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
(timeSeconds) =>
|
||||
{
|
||||
// Invoke to not interfere with any inserting
|
||||
BeginInvoke(new Action(() => {
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
GoToTimeAndSelectPrecedingParagraph(timeSeconds);
|
||||
}));
|
||||
},
|
||||
@ -23383,6 +23384,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
var hasAudioTracks = HasAudioTracks(_videoFileName);
|
||||
if (!hasAudioTracks)
|
||||
{
|
||||
AddEmptyWaveform();
|
||||
return;
|
||||
}
|
||||
|
||||
ShowStatus("Waveform load failed - install ffmpeg in Options - Settings - Waveform");
|
||||
}
|
||||
};
|
||||
@ -23406,6 +23414,33 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
SetAssaResolutionWithChecks();
|
||||
}
|
||||
|
||||
private bool HasAudioTracks(string videoFileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (FileUtil.IsMatroskaFile(videoFileName))
|
||||
{
|
||||
var matroska = new MatroskaFile(videoFileName);
|
||||
if (matroska.IsValid)
|
||||
{
|
||||
return matroska.GetTracks().Any(p => p.IsAudio);
|
||||
}
|
||||
}
|
||||
|
||||
if (mediaPlayer.VideoPlayer is LibMpvDynamic libMpv)
|
||||
{
|
||||
return libMpv.AudioTracks.Count > 0;
|
||||
}
|
||||
|
||||
var info = FfmpegMediaInfo.Parse(videoFileName);
|
||||
return info.Tracks.Any(p => p.TrackType == FfmpegTrackType.Audio);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAssaResolutionWithChecks()
|
||||
{
|
||||
if (Configuration.Settings.SubtitleSettings.AssaResolutionAutoNew && IsAssa() && _videoInfo?.Height > 0)
|
||||
@ -36313,7 +36348,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (unfixableParagraphs.Count > 0)
|
||||
{
|
||||
BeginInvoke(new Action(() => {
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
_dialog?.Dispose();
|
||||
_dialog = new BeautifyTimeCodes.BeautifyTimeCodesUnfixableParagraphs(unfixableParagraphs, (paragraph) =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user