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() 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() _videoInfo = new VideoInfo()
{ {
@ -20914,9 +20914,13 @@ namespace Nikse.SubtitleEdit.Forms
mediaPlayer.VideoHeight = _videoInfo.Height; mediaPlayer.VideoHeight = _videoInfo.Height;
mediaPlayer.SetSubtitleText(string.Empty, new Paragraph(), new Subtitle(), GetCurrentSubtitleFormat()); mediaPlayer.SetSubtitleText(string.Empty, new Paragraph(), new Subtitle(), GetCurrentSubtitleFormat());
UiUtil.ShowSubtitle(_subtitle, mediaPlayer, GetCurrentSubtitleFormat()); UiUtil.ShowSubtitle(_subtitle, mediaPlayer, GetCurrentSubtitleFormat());
if (Configuration.Settings.General.WaveformAutoGenWhenOpeningVideo)
{
AddEmptyWaveform(); AddEmptyWaveform();
} }
} }
}
private void VideoEnded(object sender, EventArgs e) private void VideoEnded(object sender, EventArgs e)
{ {