# Third-party notices for the audio decoder in this directory

The files `libav-*-videostar-audio.*` in this directory are a WebAssembly build of parts of
[FFmpeg](https://ffmpeg.org/), produced with [libav.js](https://github.com/Yahweasel/libav.js).
They are used to decode AC-3, E-AC-3 and DTS audio, which no browser can decode natively.

## Licence

FFmpeg's libavcodec and libavutil, as configured here, are licensed under the
**GNU Lesser General Public License version 2.1 or later**. The full text is in `LICENSE.md`
alongside this file. The libav.js wrapper code is 0BSD.

The build is configured **without** `--enable-gpl` and `--enable-nonfree`, so nothing in it is
under the GPL and nothing is non-redistributable.

## Corresponding source

Under the LGPL you are entitled to the source that produced these binaries, and to replace them
with your own build. Everything needed to do so:

- **FFmpeg** version 9.0, unmodified upstream release, plus the patches carried in
  [libav.js](https://github.com/Yahweasel/libav.js) under `patches/`.
- **libav.js** as cloned by `tools/build-libav.sh` in this repository.
- **Configuration**: the variant `videostar-audio`, which is exactly

      --enable-decoder=ac3 --enable-decoder=eac3 --enable-decoder=dca
      --enable-parser=ac3 --enable-parser=dca

  on top of libav.js's `avcodec` and `avframe` fragments. No encoders, no muxers, no demuxers and
  no filters are built in.
- **Build**: `tools/build-libav.sh`, which runs the whole thing inside the official
  `emscripten/emsdk` image and copies the results here.

Replacing this build with your own is a matter of dropping the files in this directory and
updating `LIBAV_VERSION` / `LIBAV_VARIANT` in `src/core/audio/libav-decoder.ts`.

## Trademarks

AC-3 and E-AC-3 are referred to by those names throughout this project, and never by Dolby's
trademarks. The relevant patents have expired; the trademarks have not, and this project has no
licence to them.
