Skip to content

Commit 2e9ba51

Browse files
committed
compatibility fixes for net framework build
1 parent 47e6e78 commit 2e9ba51

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ private VideoSeekIndex LoadOrCreateVideoSeekIndex(string mediaFilePath, int stre
498498

499499
if (File.Exists(seekFilePath))
500500
{
501-
using (var stream = File.OpenRead(seekFilePath))
502-
return VideoSeekIndex.Load(stream);
501+
using var stream = File.OpenRead(seekFilePath);
502+
return VideoSeekIndex.Load(stream);
503503
}
504504
else
505505
{

Unosquare.FFME/Common/DataFrame.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
/// </summary>
1111
public sealed unsafe class DataFrame
1212
{
13+
private readonly byte[] PacketData;
14+
1315
/// <summary>
1416
/// Initializes a new instance of the <see cref="DataFrame"/> class.
1517
/// </summary>
@@ -31,7 +33,7 @@ internal DataFrame(MediaPacket packet, StreamInfo stream, MediaEngine mediaCore)
3133
Buffer.MemoryCopy(packet.Pointer->data, targetPointer, bufferLength, bufferLength);
3234
}
3335

34-
PacketData = new Memory<byte>(targetData);
36+
PacketData = targetData;
3537
}
3638

3739
PacketPosition = packet.Position;
@@ -70,11 +72,6 @@ internal DataFrame(MediaPacket packet, StreamInfo stream, MediaEngine mediaCore)
7072
/// </summary>
7173
public TimeSpan DecodingTime { get; }
7274

73-
/// <summary>
74-
/// Gets the raw byte data of the data packet.
75-
/// </summary>
76-
public Memory<byte> PacketData { get; }
77-
7875
/// <summary>
7976
/// Gets a value indicating whether the presentation time of this data
8077
/// frame was guessed.
@@ -95,6 +92,12 @@ internal DataFrame(MediaPacket packet, StreamInfo stream, MediaEngine mediaCore)
9592
/// </summary>
9693
public long PacketPosition { get; }
9794

95+
/// <summary>
96+
/// Gets the raw byte data of the data packet.
97+
/// </summary>
98+
/// <returns>The raw bytes of the packet data. May return null when no packet data is available.</returns>
99+
public byte[] GetPacketData() => PacketData;
100+
98101
/// <summary>
99102
/// Guesses the start time of the packet.
100103
/// Side effect modify the <see cref="StartTime"/> property and the

0 commit comments

Comments
 (0)