mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
PrepareSnapshotSize error : ratio=source.PrimaryVideoStream.Width / 0
ratio=source.PrimaryVideoStream.Height / 0
Former-commit-id: 74593461d4
This commit is contained in:
parent
edd63f7d95
commit
a94fc05144
1 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
|
|||
{
|
||||
if (size.Value.Width == 0)
|
||||
{
|
||||
var ratio = source.PrimaryVideoStream.Width / (double) size.Value.Width;
|
||||
var ratio = source.PrimaryVideoStream.Height / (double) size.Value.Height;
|
||||
|
||||
size = new Size((int) (source.PrimaryVideoStream.Width * ratio),
|
||||
(int) (source.PrimaryVideoStream.Height * ratio));
|
||||
|
@ -84,7 +84,7 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
|
|||
|
||||
if (size.Value.Height == 0)
|
||||
{
|
||||
var ratio = source.PrimaryVideoStream.Height / (double) size.Value.Height;
|
||||
var ratio = source.PrimaryVideoStream.Width / (double) size.Value.Width;
|
||||
|
||||
size = new Size((int) (source.PrimaryVideoStream.Width * ratio),
|
||||
(int) (source.PrimaryVideoStream.Height * ratio));
|
||||
|
|
Loading…
Reference in a new issue