Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Adapted VideoFormat() callback #526

Merged
merged 2 commits into from
Feb 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use the sample aspect ratio if present in the track info
Fixes #386
  • Loading branch information
jeremyVignelles committed Feb 27, 2019
commit 353d387b1f7722e1baf17ec7803077442139b1e1
6 changes: 5 additions & 1 deletion src/Vlc.DotNet.Wpf/VlcVideoSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ private uint VideoFormat(out IntPtr userdata, IntPtr chroma, ref uint width, ref
{
if (track.Type == MediaTrackTypes.Video)
{
var trackInfo = track.TrackInfo as VideoTrack;
var trackInfo = (VideoTrack)track.TrackInfo;
width = trackInfo.Width;
height = trackInfo.Height;
if (trackInfo.SarDen != 0)
{
width = width * trackInfo.SarNum / trackInfo.SarDen;
}
break;
}
}
Expand Down