Refactor GetOutputExtension

This commit is contained in:
copecone committed 2026-07-07 15:58:09 +09:00
1 parent 9e30c1302f
commit 08b36b1866
2 files changed
+5 -6

No files matched your search

+4 -5
View File
@@ -384,7 +384,7 @@ namespace ADOFAIRenderer.Core
private IEnumerator SetupPlay()
{
if (Configuration.RenderAudio && GetOutputExtension() != ".mp4")
if (Configuration.RenderAudio && GetOutputExtension(Configuration.Codec) != ".mp4")
{
Configuration.AudioSampleRate = 48000;
}
@@ -468,7 +468,7 @@ namespace ADOFAIRenderer.Core
var videoFPS = Configuration.VideoFPS;
var selectedCodec = Configuration.Codec;
var ext = GetOutputExtension();
var ext = GetOutputExtension(selectedCodec);
var startTime = DateTime.Now;
var fileName = startTime.ToString("yyyy-MM-dd HH-mm-ss") + ext;
@@ -803,10 +803,9 @@ namespace ADOFAIRenderer.Core
Cursor.visible = true;
}
private string GetOutputExtension()
private string GetOutputExtension(Codec codec)
{
var selectedCodec = Configuration.Codec;
return selectedCodec switch
return codec switch
{
Codec.AV1 or Codec.VP9 => ".webm",
Codec.VVC => ".mkv",