Improve support for load of online audio-only media

This commit is contained in:
niksedk 2021-12-06 06:09:20 +01:00
parent f05c81fc41
commit 601fa422e1

View File

@ -20898,7 +20898,7 @@ namespace Nikse.SubtitleEdit.Forms
private void LoadVideoInfoAfterVideoFromUrlLoad()
{
if (VideoFileNameIsUrl && _videoInfo == null && mediaPlayer.VideoPlayer is LibMpvDynamic libMpv && libMpv.VideoWidth > 0)
if (VideoFileNameIsUrl && _videoInfo == null && mediaPlayer.VideoPlayer is LibMpvDynamic libMpv && libMpv.Duration > 0)
{
_videoInfo = new VideoInfo()
{
@ -20914,7 +20914,11 @@ namespace Nikse.SubtitleEdit.Forms
mediaPlayer.VideoHeight = _videoInfo.Height;
mediaPlayer.SetSubtitleText(string.Empty, new Paragraph(), new Subtitle(), GetCurrentSubtitleFormat());
UiUtil.ShowSubtitle(_subtitle, mediaPlayer, GetCurrentSubtitleFormat());
AddEmptyWaveform();
if (Configuration.Settings.General.WaveformAutoGenWhenOpeningVideo)
{
AddEmptyWaveform();
}
}
}