Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,47 @@ jobs:
- name: Publish
run: dotnet publish AirPlay/AirPlay.csproj --configuration Release --runtime win-x64 --self-contained true --output ./publish/win-x64

- name: Download FFmpeg
shell: pwsh
run: |
$ffmpegUrl = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip"
Invoke-WebRequest -Uri $ffmpegUrl -OutFile ffmpeg.zip
Expand-Archive -Path ffmpeg.zip -DestinationPath ffmpeg-tmp
# Copy ffmpeg.exe and ffplay.exe to publish directory
$binDir = Get-ChildItem -Path ffmpeg-tmp -Recurse -Directory -Filter "bin" | Select-Object -First 1
Copy-Item "$($binDir.FullName)\ffmpeg.exe" -Destination ./publish/win-x64/
Copy-Item "$($binDir.FullName)\ffplay.exe" -Destination ./publish/win-x64/
Comment on lines +34 to +43

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow downloads a moving latest FFmpeg ZIP without any integrity verification (checksum/signature) and then executes the binaries. For supply-chain safety and reproducibility, consider pinning to a specific release/build (or at least validating a published SHA256) before copying into artifacts.

Copilot uses AI. Check for mistakes.

- name: Build libfdk-aac from source
shell: bash
run: |
# Build FDK-AAC from official source using MSYS2 (pre-installed on windows-latest)
export MSYSTEM=MINGW64
export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin:$PATH"

# Install build dependencies
pacman -S --noconfirm --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make
Comment on lines +45 to +53

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step assumes MSYS2 is already present at C:\msys64 and that pacman is available from the selected bash shell. To make CI more robust against runner image changes, consider installing MSYS2 explicitly via msys2/setup-msys2@v2 (and running the build in an MSYS2 shell), rather than relying on a preinstalled location.

Copilot uses AI. Check for mistakes.

# Clone and build fdk-aac
git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git fdk-aac-src
cd fdk-aac-src

# Use CMake for a simpler build
mkdir build && cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
cmake --build . --config Release

# Find and copy the DLL
echo "Built files:"
find . -name "*.dll" -type f
DLL_PATH=$(find . -name "fdk-aac*.dll" -o -name "libfdk-aac*.dll" | head -1)
if [ -z "$DLL_PATH" ]; then
echo "ERROR: No FDK-AAC DLL found after build"
exit 1
fi
cp -v "$DLL_PATH" ../../publish/win-x64/libfdk-aac-2.dll
echo "Successfully built and copied libfdk-aac-2.dll"

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
13 changes: 13 additions & 0 deletions AirPlay/AirPlayService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,21 @@ public async Task StartAsync(CancellationToken cancellationToken)
};

_audiobuf = new List<byte>();
int pcmReceivedCount = 0;
_airPlayReceiver.OnPCMDataReceived += (s, e) =>
{
pcmReceivedCount++;
if (pcmReceivedCount <= 5 || pcmReceivedCount % 500 == 0)
{
bool allZeros = true;
int checkLen = Math.Min(e.Length, 100);
for (int i = 0; i < checkLen; i++)
{
if (e.Data[i] != 0) { allZeros = false; break; }
}
Console.WriteLine($"[DEBUG-PCM] OnPCMDataReceived #{pcmReceivedCount}: len={e.Length}, allZeros={allZeros}");
}

// Play audio through speakers
lock (_audioOutputLock)
{
Expand Down
Loading
Loading