Skip to content

Commit

Permalink
compatibility fixes for net framework build
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodivece committed Dec 28, 2019
1 parent 47e6e78 commit 2e9ba51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ private VideoSeekIndex LoadOrCreateVideoSeekIndex(string mediaFilePath, int stre

if (File.Exists(seekFilePath))
{
using (var stream = File.OpenRead(seekFilePath))
return VideoSeekIndex.Load(stream);
using var stream = File.OpenRead(seekFilePath);
return VideoSeekIndex.Load(stream);
}
else
{
Expand Down
15 changes: 9 additions & 6 deletions Unosquare.FFME/Common/DataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/// </summary>
public sealed unsafe class DataFrame
{
private readonly byte[] PacketData;

/// <summary>
/// Initializes a new instance of the <see cref="DataFrame"/> class.
/// </summary>
Expand All @@ -31,7 +33,7 @@ internal DataFrame(MediaPacket packet, StreamInfo stream, MediaEngine mediaCore)
Buffer.MemoryCopy(packet.Pointer->data, targetPointer, bufferLength, bufferLength);
}

PacketData = new Memory<byte>(targetData);
PacketData = targetData;
}

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

/// <summary>
/// Gets the raw byte data of the data packet.
/// </summary>
public Memory<byte> PacketData { get; }

/// <summary>
/// Gets a value indicating whether the presentation time of this data
/// frame was guessed.
Expand All @@ -95,6 +92,12 @@ internal DataFrame(MediaPacket packet, StreamInfo stream, MediaEngine mediaCore)
/// </summary>
public long PacketPosition { get; }

/// <summary>
/// Gets the raw byte data of the data packet.
/// </summary>
/// <returns>The raw bytes of the packet data. May return null when no packet data is available.</returns>
public byte[] GetPacketData() => PacketData;

/// <summary>
/// Guesses the start time of the packet.
/// Side effect modify the <see cref="StartTime"/> property and the
Expand Down

0 comments on commit 2e9ba51

Please sign in to comment.