Skip to content

Commit 068953b

Browse files
committed
Updates to v3.7.13
- FlyleafHost.WinForms: Another try to avoid designer issues (+Misc)
1 parent 694cf75 commit 068953b

5 files changed

Lines changed: 10 additions & 15 deletions

File tree

FlyleafLib/Controls/WPF/FlyleafHost.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ IsStandAlone [ReadOnly]
9797
public bool Disposed { get; private set; }
9898

9999
static bool isDesginMode;
100-
static int idGenerator;
100+
static int idGenerator = 1;
101101
static nint NONE_STYLE = (nint) (WindowStyles.WS_MINIMIZEBOX | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_VISIBLE); // WS_MINIMIZEBOX required for swapchain
102102
static Rect rectRandom = new(1, 2, 3, 4);
103103

@@ -1531,6 +1531,7 @@ public virtual void SetSurface()
15311531

15321532
// Required for some reason (WindowStyle.None will not be updated with our style)
15331533
Surface = new();
1534+
Surface.Name = $"Surface_{UniqueId}";
15341535
Surface.Width = Surface.Height = 1; // Will be set on loaded
15351536
Surface.WindowStyle = WindowStyle.None;
15361537
Surface.ResizeMode = ResizeMode.NoResize;
@@ -1617,6 +1618,7 @@ public virtual void SetOverlay()
16171618
SetWindowPos(OverlayHandle, IntPtr.Zero, 0, 0, (int)Surface.ActualWidth, (int)Surface.ActualHeight,
16181619
(uint)(SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_NOACTIVATE));
16191620

1621+
Overlay.Name = $"Overlay_{UniqueId}";
16201622
Overlay.Background = Brushes.Transparent;
16211623
Overlay.ShowInTaskbar = false;
16221624
Overlay.Owner = Surface;

FlyleafLib/Controls/WinForms/FlyleafHost.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,6 @@ public void NormalScreen()
285285
// TBR: Related to Renderer's WndProc
286286
protected override void OnPaintBackground(PaintEventArgs pe)
287287
{
288-
if (designMode)
289-
{
290-
base.OnPaintBackground(pe);
291-
return;
292-
}
293-
294288
if (Player != null && !Player.renderer.SCDisposed)
295289
Player.renderer.Present();
296290
else

FlyleafLib/FlyleafLib.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageIconUrl />
99
<RepositoryUrl></RepositoryUrl>
1010
<Description>Media Player .NET Library for WinUI 3/WPF/WinForms (based on FFmpeg/DirectX)</Description>
11-
<Version>3.7.12</Version>
11+
<Version>3.7.13</Version>
1212
<Authors>SuRGeoNix</Authors>
1313
<Copyright>SuRGeoNix © 2023</Copyright>
1414
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
@@ -17,10 +17,7 @@
1717
<IncludeSymbols>true</IncludeSymbols>
1818
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1919
<PackageReleaseNotes>
20-
- Player: Switching playback's task to thread and set's default priority to above normal
21-
- Player: Introduces Config.Player.ThreadPriority to change the playback's thread priority
22-
- Plugins.StreamSuggester: Fixes an issue when AllowFindStreamInfo is disabled it wouldn't suggest any stream at all
23-
- FlyleafHost.WinForms: Possible fix for a possible? designer issue
20+
- FlyleafHost.WinForms: Another try to avoid designer issues
2421
</PackageReleaseNotes>
2522
</PropertyGroup>
2623

FlyleafLib/MediaPlayer/Player.Screamers.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Diagnostics;
33
using System.Threading;
44

5-
using FFmpeg.AutoGen;
5+
//using FFmpeg.AutoGen; Avoid using FFmpeg.Autogen in Player (all partial classes) as it can cause design issues to WinForms (when lib and app have different assembly versions)
66

77
using FlyleafLib.MediaFramework.MediaDecoder;
88

@@ -570,7 +570,9 @@ private long GetBufferedDuration()
570570
return 0;
571571

572572
var decoder = VideoDecoder.Frames.ToArray()[^1].timestamp - vFrame.timestamp;
573-
var demuxer = VideoDemuxer.VideoPackets.LastTimestamp == ffmpeg.AV_NOPTS_VALUE ? 0 : (VideoDemuxer.VideoPackets.LastTimestamp - VideoDemuxer.StartTime) - vFrame.timestamp;
573+
var demuxer = VideoDemuxer.VideoPackets.LastTimestamp == -9223372036854775808 // AV_NOPTS_VALUE (to avoid designer issues)
574+
? 0 :
575+
(VideoDemuxer.VideoPackets.LastTimestamp - VideoDemuxer.StartTime) - vFrame.timestamp;
574576

575577
return Math.Max(decoder, demuxer);
576578
}

Tests/WpfFlyleafHost/OverlayStandAlone.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:WpfFlyleafHost"
77
xmlns:fl="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib"
8-
mc:Ignorable="d"
8+
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
99
Title="OverlayStandAlone" Height="450" Width="800">
1010
<Grid>
1111
<TextBlock Text="Overlay Header Here" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="40" Foreground="DarkRed"/>

0 commit comments

Comments
 (0)