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

Commit

Permalink
Use the sample aspect ratio if present in the track info
Browse files Browse the repository at this point in the history
Fixes #386
  • Loading branch information
jeremyVignelles committed Feb 27, 2019
1 parent c382d37 commit 353d387
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 353d387

Please sign in to comment.