mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 10:05:44 +00:00
Minor refactor to use yield return
This commit is contained in:
parent
1a49b4eec3
commit
bfcb1b9544
1 changed files with 1 additions and 4 deletions
|
|
@ -70,17 +70,14 @@ public static class FFMpegDownloader
|
||||||
private static IEnumerable<string> ExtractZipAndSave(Stream zipStream, string binaryFolder)
|
private static IEnumerable<string> ExtractZipAndSave(Stream zipStream, string binaryFolder)
|
||||||
{
|
{
|
||||||
using var archive = new ZipArchive(zipStream, ZipArchiveMode.Read);
|
using var archive = new ZipArchive(zipStream, ZipArchiveMode.Read);
|
||||||
List<string> files = new();
|
|
||||||
foreach (var entry in archive.Entries)
|
foreach (var entry in archive.Entries)
|
||||||
{
|
{
|
||||||
if (entry.Name is "ffmpeg" or "ffmpeg.exe" or "ffprobe.exe" or "ffprobe" or "ffplay.exe" or "ffplay")
|
if (entry.Name is "ffmpeg" or "ffmpeg.exe" or "ffprobe.exe" or "ffprobe" or "ffplay.exe" or "ffplay")
|
||||||
{
|
{
|
||||||
var filePath = Path.Combine(binaryFolder, entry.Name);
|
var filePath = Path.Combine(binaryFolder, entry.Name);
|
||||||
entry.ExtractToFile(filePath, true);
|
entry.ExtractToFile(filePath, true);
|
||||||
files.Add(filePath);
|
yield return filePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return files;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue