Improvements to ffmpeg decoders build script (#1110)

## Description
A few improvements to the ffmpeg decoder & mpv build scripts. Mainly
changes the dependency fetching so the scripts are more idempotent,
though some rebuilds still always occur.

### Related issues
Related to
https://github.com/damontecres/Wholphin/pull/1106#issuecomment-4077678690

### Testing
Local builds

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Ray 2026-03-17 17:04:27 -04:00 committed by GitHub
parent 3af9775592
commit d184990b16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,14 @@
# FFmpeg ExoPlayer decoder extension module
Builds the ffmpeg decoder extension module for `ExoPlayer` which supports extra codecs during playback.
## Usage
```sh
./build_ffmpeg_decoder.sh /path/to/android/ndk
```
Or clean build:
```sh
./build_ffmpeg_decoder.sh /path/to/android/ndk --clean
```

View file

@ -27,6 +27,12 @@ AV1_MODULE_PATH="$MEDIA_PATH/libraries/decoder_av1/src/main"
HOST="$(uname -s | tr '[:upper:]' '[:lower:]')"
HOST_PLATFORM="$HOST-x86_64"
if [[ "$2" == "--clean" ]]; then
rm -rf ffmpeg_decoder
rm -f "$TARGET_PATH/lib-decoder-ffmpeg-release.aar"
rm -f "$TARGET_PATH/lib-decoder-av1-release.aar"
fi
mkdir -p "$TARGET_PATH"
mkdir -p ffmpeg_decoder
@ -38,14 +44,16 @@ pushd ffmpeg_decoder || exit
if [[ -d media ]]; then
pushd media || exit
git checkout --force "$media_version"
git fetch origin "$media_version" --depth 1
git checkout --force FETCH_HEAD
else
git clone https://github.com/androidx/media.git --depth 1 --single-branch -b "$media_version" media
fi
if [[ -d ffmpeg ]]; then
pushd ffmpeg || exit
git checkout --force "$FFMPEG_BRANCH"
git fetch origin "$FFMPEG_BRANCH" --depth 1
git checkout --force FETCH_HEAD
else
git clone https://github.com/FFmpeg/FFmpeg --depth 1 --single-branch -b "$FFMPEG_BRANCH" ffmpeg
fi
@ -68,7 +76,8 @@ pushd "$AV1_MODULE_PATH/jni" || exit
if [[ -d dav1d ]]; then
pushd dav1d || exit
git checkout --force "$DAV1D_BRANCH"
git fetch origin "$DAV1D_BRANCH" --depth 1
git checkout --force FETCH_HEAD
else
git clone https://code.videolan.org/videolan/dav1d --depth 1 --single-branch -b "$DAV1D_BRANCH" dav1d
fi

View file

@ -15,7 +15,8 @@ function clone(){
if [[ -d "$dir" ]]; then
pushd "$dir" || exit
git checkout --force "$branch"
git fetch origin "$branch" --depth 1
git checkout --force FETCH_HEAD
popd || exit
else
git clone "$repo" --depth 1 --single-branch -b "$branch" "$dir" "$@"