Skip to content

Commit

Permalink
Fixes external subtitles critical issue
Browse files Browse the repository at this point in the history
Former-commit-id: 7be6ecb
  • Loading branch information
SuRGeoNix committed May 3, 2021
1 parent bb2dba0 commit 3b288ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions FlyleafLib/Controls/WPF/FlyleafWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ void WFH_Loaded(object sender, RoutedEventArgs e)
public void Wndhost_LocationChanged(object sender, EventArgs e)
{
//Console.WriteLine("Wndhost_LocationChanged");
if (WindowBack == null) return;

var locationFromScreen = windowsFormsHost.PointToScreen(_zeroPoint);
var source = PresentationSource.FromVisual(WindowBack);
var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen);
Expand Down
4 changes: 2 additions & 2 deletions FlyleafLib/MediaPlayer/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public void Open(StreamBase inputStream)
else if (inputStream is AudioStream)
{
Utils.EnsureThreadDone(tOpenAudio);
Session.CurAudioStream.InUse = false;
if (Session.CurAudioStream != null) Session.CurAudioStream.InUse = false;
if (Config.audio.Enabled == false) Config.audio.SetEnabled();

tOpenAudio = new Thread(() => { OpenAudio((AudioStream)inputStream); });
Expand All @@ -382,7 +382,7 @@ public void Open(StreamBase inputStream)
else if (inputStream is SubtitlesStream)
{
Utils.EnsureThreadDone(tOpenSubs);
Session.CurSubtitleStream.InUse = false;
if (Session.CurSubtitleStream != null) Session.CurSubtitleStream.InUse = false;
Session.SubsText = null; sFrame = null;
if (Config.subs.Enabled == false) Config.subs.SetEnabled();

Expand Down

0 comments on commit 3b288ae

Please sign in to comment.