Skip to content

Commit

Permalink
WinGUI: Fix NVidia hardware decoding on Windows. Fixes #5569
Browse files Browse the repository at this point in the history
(cherry picked from commit 05242e8241cb3f3ede8455965e41bc1bf753ee00)
  • Loading branch information
sr55 committed Dec 5, 2023
1 parent 9a8d1a9 commit fe7ab6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs
Expand Up @@ -33,5 +33,7 @@ public class Source
/// Gets or sets the path.
/// </summary>
public string Path { get; set; }

public int HWDecode { get; set; }
}
}
Expand Up @@ -96,12 +96,21 @@ private Source CreateSource(EncodeTask job)
break;
}

bool nvdec = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableNvDecSupport);

int hwDecode = 0;
if (nvdec)
{
hwDecode = (int)NativeConstants.HB_DECODE_SUPPORT_NVDEC;
}

Source source = new Source
{
Title = job.Title,
Range = range,
Angle = job.Angle,
Path = job.Source,
HWDecode = hwDecode
};
return source;
}
Expand Down

0 comments on commit fe7ab6f

Please sign in to comment.