Skip to content

Commit

Permalink
Merge pull request #182 from nyanmisaka/ff5.1.1
Browse files Browse the repository at this point in the history
New upstream version 5.1.1
  • Loading branch information
nyanmisaka committed Sep 2, 2022
2 parents 4e738fb + a91308b commit a9d849e
Show file tree
Hide file tree
Showing 89 changed files with 362 additions and 248 deletions.
31 changes: 31 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.

version 5.1.1:
- avformat/asfdec_o: limit recursion depth in asf_read_unknown()
- avformat/mov: Check count sums in build_open_gop_key_points()
- doc/git-howto.texi: Document commit signing
- libavcodec/8bps: Check that line lengths fit within the buffer
- avcodec/midivid: Perform lzss_uncompress() before ff_reget_buffer()
- libavformat/iff: Check for overflow in body_end calculation
- avformat/avidec: Prevent entity expansion attacks
- avcodec/h263dec: Sanity check against minimal I/P frame size
- avcodec/hevcdec: Check s->ref in the md5 path similar to hwaccel
- avcodec/mpegaudiodec_template: use unsigned shift in handle_crc()
- avformat/subviewerdec: Make read_ts() more flexible
- avcodec/mjpegdec: bayer and rct are incompatible
- MAINTAINERS: Add ED25519 key for signing my commits in the future
- avcodec/pngdec: Fix APNG_DISPOSE_OP_BACKGROUND
- avcodec/libvpx: fix assembling vp9 packets with alpha channel
- fftools/ffmpeg_opt: try to propagate the requested output channel layout
- avcodec/libsvtav1: properly initialize the flush EbBufferHeaderType struct
- configure: enable the av1_frame_split bsf for the av1 decoder
- swresample/swresample: fill the correct buffer to print the output layout string
- ffprobe: restore reporting error code for failed inputs
- ipfsgateway: Remove default gateway
- avcodec/libspeexdec: Fix use of uninitialized value
- avformat/avisynth: use ch_layout.nb_channels for channel count
- fate/lavf-image: Disable file checksums for exr tests
- tests/fate-run: Allow to skip file checksums for lavf_image
- fate/imf: Rename IMF fate-target
- avcodec/alac: don't fail if channels aren't set during init() when extradata is valid
- configure: properly require libx264 if enabled


version 5.1:
- add ipfs/ipns protocol support
- dialogue enhance audio filter
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV CFLAGS="-I${TARGET_DIR}/include $CFLAGS"

# Prepare Debian build environment
RUN apt-get update \
&& yes | apt-get install -y apt-transport-https curl ninja-build debhelper gnupg wget devscripts mmv equivs git nasm pkg-config subversion dh-autoreconf libpciaccess-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxcb-shm0-dev libxcb-sync-dev libxshmfence-dev libxext-dev libxfixes-dev libxcb1-dev libxrandr-dev libzstd-dev libelf-dev libudev-dev python3-pip zip unzip tar flex bison
&& yes | apt-get install -y apt-transport-https curl ninja-build debhelper gnupg wget devscripts mmv equivs git nasm pkg-config subversion dh-autoreconf libpciaccess-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxcb-shm0-dev libxcb-sync-dev libxshmfence-dev libxext-dev libxfixes-dev libxcb1-dev libxrandr-dev libzstd-dev libelf-dev python3-pip zip unzip tar flex bison

# Install newer tools from pip3
RUN pip3 install --upgrade pip \
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ Leo Izen (thebombzen) B6FD 3CFC 7ACF 83FC 9137 6945 5A71 C331 FD2F A19A
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
Lynne FE50 139C 6805 72CA FD52 1F8D A2FE A5F0 3F03 4464
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
DD1E C9E8 DE08 5C62 9B3E 1846 B18E 8928 B394 8D64
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
Niklas Haas (haasn) 1DDB 8076 B14D 5B48 32FC 99D9 EB52 DA9C 02BA 6FB4
Nikolay Aleksandrov 8978 1D8C FB71 588E 4B27 EAA8 C4F0 B5FC E011 13B1
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1
5.1.1
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1
5.1.1
2 changes: 1 addition & 1 deletion build-win64
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ done

# Use the latest distro for toolchains
distro="ubuntu:jammy"
ffrevison="2"
ffrevison="1"
image_name="jellyfin-ffmpeg-build-windows-win64"
package_temporary_dir="$( mktemp -d )"
current_user="$( whoami )"
Expand Down
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# We just wrap `build` so this is really it
name: "jellyfin-ffmpeg"
version: "5.1-2"
version: "5.1.1-1"
packages:
- buster-amd64
- buster-armhf
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2781,7 +2781,7 @@ atrac3al_decoder_select="mdct"
atrac3p_decoder_select="mdct sinewin"
atrac3pal_decoder_select="mdct sinewin"
atrac9_decoder_select="mdct"
av1_decoder_select="cbs_av1"
av1_decoder_select="av1_frame_split_bsf cbs_av1"
bink_decoder_select="blockdsp hpeldsp"
binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
Expand Down Expand Up @@ -6666,7 +6666,7 @@ enabled libvpx && {
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && {
[ "$toolchain" != "msvc" ] ||
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
jellyfin-ffmpeg (5.1.1-1) unstable; urgency=medium

* New upstream version 5.1.1
* Update dependencies

-- nyanmisaka <[email protected]> Fri, 2 Sep 2022 15:43:17 +0800

jellyfin-ffmpeg (5.1-2) unstable; urgency=medium

* Revert Mesa to the last release
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintainer: Jellyfin Packaging Team <[email protected]>
Uploaders: Jellyfin Packaging Team <[email protected]>
Rules-Requires-Root: no
Homepage: https://ffmpeg.org/
Standards-Version: 5.1
Standards-Version: 5.1.1
Vcs-Git: https://github.com/jellyfin/jellyfin-ffmpeg.git
Vcs-Browser: https://github.com/jellyfin/jellyfin-ffmpeg
Build-Depends:
Expand Down
18 changes: 10 additions & 8 deletions debian/patches/0036-enable-gcc-vectorization-and-lto-auto.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ Index: jellyfin-ffmpeg/libavcodec/x86/cabac.h
===================================================================
--- jellyfin-ffmpeg.orig/libavcodec/x86/cabac.h
+++ jellyfin-ffmpeg/libavcodec/x86/cabac.h
@@ -177,6 +177,7 @@

#if HAVE_7REGS && !BROKEN_COMPILER
#define get_cabac_inline get_cabac_inline_x86
+#pragma GCC optimize("no-tree-vectorize")
static
#if defined(_WIN32) && !defined(_WIN64) && defined(__clang__)
av_noinline
@@ -183,6 +183,9 @@ av_noinline
#else
av_always_inline
#endif
+#ifdef __GNUC__
+__attribute__((optimize("-fno-tree-vectorize")))
+#endif
int get_cabac_inline_x86(CABACContext *c, uint8_t *const state)
{
int bit, tmp;
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 5.1
PROJECT_NUMBER = 5.1.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
22 changes: 21 additions & 1 deletion doc/git-howto.texi
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,18 @@ to make sure you don't have untracked files or deletions.
git add [-i|-p|-A] <filenames/dirnames>
@end example

Make sure you have told Git your name and email address
Make sure you have told Git your name, email address and GPG key

@example
git config --global user.name "My Name"
git config --global user.email my@@email.invalid
git config --global user.signingkey ABCDEF0123245
@end example

Enable signing all commits or use -S

@example
git config --global commit.gpgsign true
@end example

Use @option{--global} to set the global configuration for all your Git checkouts.
Expand Down Expand Up @@ -423,6 +430,19 @@ git checkout -b svn_23456 $SHA1
where @var{$SHA1} is the commit hash from the @command{git log} output.


@chapter gpg key generation

If you have no gpg key yet, we recommend that you create a ed25519 based key as it
is small, fast and secure. Especially it results in small signatures in git.

@example
gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "human@@server.com"
@end example

When generating a key, make sure the email specified matches the email used in git as some sites like
github consider mismatches a reason to declare such commits unverified. After generating a key you
can add it to the MAINTAINER file and upload it to a keyserver.

@chapter Pre-push checklist

Once you have a set of commits that you feel are ready for pushing,
Expand Down
2 changes: 1 addition & 1 deletion docker-build-win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ popd
# LZMA
mkdir xz
pushd xz
xz_ver="5.2.5"
xz_ver="5.2.6"
xz_link="https://sourceforge.net/projects/lzmautils/files/xz-${xz_ver}.tar.xz/download"
wget ${xz_link} -O xz.tar.xz
tar xaf xz.tar.xz
Expand Down
19 changes: 10 additions & 9 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@ prepare_extra_amd64() {
pushd ${SOURCE_DIR}
mkdir libdrm
pushd libdrm
libdrm_ver="2.4.112"
libdrm_ver="2.4.113"
libdrm_link="https://dri.freedesktop.org/libdrm/libdrm-${libdrm_ver}.tar.xz"
wget ${libdrm_link} -O libdrm.tar.xz
tar xaf libdrm.tar.xz
meson setup libdrm-${libdrm_ver} drm_build \
--prefix=${TARGET_DIR} \
--libdir=lib \
--buildtype=release \
-D{amdgpu,radeon,intel,udev}=true \
-D{valgrind,freedreno,vc4,vmwgfx,nouveau,man-pages}=false
-D{udev,tests,install-test-programs}=false \
-D{amdgpu,radeon,intel}=enabled \
-D{valgrind,freedreno,vc4,vmwgfx,nouveau,man-pages}=disabled
meson configure drm_build
ninja -C drm_build install
cp ${TARGET_DIR}/lib/libdrm*.so* ${SOURCE_DIR}/libdrm
Expand Down Expand Up @@ -230,7 +231,7 @@ prepare_extra_amd64() {
# Provides MSDK runtime (libmfxhw64.so.1) for 11th Gen Rocket Lake and older
# Provides MFX dispatcher (libmfx.so.1) for FFmpeg
pushd ${SOURCE_DIR}
git clone -b intel-mediasdk-22.5.2 --depth=1 https://github.com/Intel-Media-SDK/MediaSDK
git clone -b intel-mediasdk-22.5.3 --depth=1 https://github.com/Intel-Media-SDK/MediaSDK
pushd MediaSDK
sed -i 's|MFX_PLUGINS_CONF_DIR "/plugins.cfg"|"/usr/lib/jellyfin-ffmpeg/lib/mfx/plugins.cfg"|g' api/mfx_dispatch/linux/mfxloader.cpp
mkdir build && pushd build
Expand All @@ -250,7 +251,7 @@ prepare_extra_amd64() {
# Provides VPL runtime (libmfx-gen.so.1.2) for 11th Gen Tiger Lake and newer
# Both MSDK and VPL runtime can be loaded by MFX dispatcher (libmfx.so.1)
pushd ${SOURCE_DIR}
git clone -b intel-onevpl-22.5.2 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu
git clone -b intel-onevpl-22.5.3 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu
pushd oneVPL-intel-gpu
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} ..
Expand All @@ -264,7 +265,7 @@ prepare_extra_amd64() {
# Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
# Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
pushd ${SOURCE_DIR}
git clone -b intel-media-22.5.2 --depth=1 https://github.com/intel/media-driver
git clone -b intel-media-22.5.3 --depth=1 https://github.com/intel/media-driver
pushd media-driver
sed -i 's|find_package(X11)||g' media_softlet/media_top_cmake.cmake media_driver/media_top_cmake.cmake
mkdir build && pushd build
Expand All @@ -284,7 +285,7 @@ prepare_extra_amd64() {

# Vulkan Headers
pushd ${SOURCE_DIR}
git clone -b v1.3.224 --depth=1 https://github.com/KhronosGroup/Vulkan-Headers
git clone -b v1.3.226 --depth=1 https://github.com/KhronosGroup/Vulkan-Headers
pushd Vulkan-Headers
mkdir build && pushd build
cmake \
Expand All @@ -297,7 +298,7 @@ prepare_extra_amd64() {

# Vulkan ICD Loader
pushd ${SOURCE_DIR}
git clone -b v1.3.224 --depth=1 https://github.com/KhronosGroup/Vulkan-Loader
git clone -b v1.3.226 --depth=1 https://github.com/KhronosGroup/Vulkan-Loader
pushd Vulkan-Loader
mkdir build && pushd build
cmake \
Expand Down Expand Up @@ -344,7 +345,7 @@ prepare_extra_amd64() {
# Minimal libs for AMD VAAPI, AMD RADV and Intel ANV
if [[ $( lsb_release -c -s ) != "bionic" ]]; then
# llvm >= 11
apt-get install -y llvm-11-dev
apt-get install -y llvm-11-dev libudev-dev
pushd ${SOURCE_DIR}
mkdir mesa
pushd mesa
Expand Down
39 changes: 38 additions & 1 deletion fftools/ffmpeg_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,43 @@ static int init_complex_filters(void)
return 0;
}

static void set_channel_layout(OutputFilter *f, OutputStream *ost)
{
int i, err;

if (ost->enc_ctx->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) {
/* Pass the layout through for all orders but UNSPEC */
err = av_channel_layout_copy(&f->ch_layout, &ost->enc_ctx->ch_layout);
if (err < 0)
exit_program(1);
return;
}

/* Requested layout is of order UNSPEC */
if (!ost->enc->ch_layouts) {
/* Use the default native layout for the requested amount of channels when the
encoder doesn't have a list of supported layouts */
av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels);
return;
}
/* Encoder has a list of supported layouts. Pick the first layout in it with the
same amount of channels as the requested layout */
for (i = 0; ost->enc->ch_layouts[i].nb_channels; i++) {
if (ost->enc->ch_layouts[i].nb_channels == ost->enc_ctx->ch_layout.nb_channels)
break;
}
if (ost->enc->ch_layouts[i].nb_channels) {
/* Use it if one is found */
err = av_channel_layout_copy(&f->ch_layout, &ost->enc->ch_layouts[i]);
if (err < 0)
exit_program(1);
return;
}
/* If no layout for the amount of channels requested was found, use the default
native layout for it. */
av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels);
}

static int open_output_file(OptionsContext *o, const char *filename)
{
AVFormatContext *oc;
Expand Down Expand Up @@ -2774,7 +2811,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
f->sample_rates = ost->enc->supported_samplerates;
}
if (ost->enc_ctx->ch_layout.nb_channels) {
av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels);
set_channel_layout(f, ost);
} else if (ost->enc->ch_layouts) {
f->ch_layouts = ost->enc->ch_layouts;
}
Expand Down
6 changes: 5 additions & 1 deletion fftools/ffprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -4026,7 +4026,7 @@ int main(int argc, char **argv)
WriterContext *wctx;
char *buf;
char *w_name = NULL, *w_args = NULL;
int ret, i;
int ret, input_ret, i;

init_dynload();

Expand Down Expand Up @@ -4150,10 +4150,14 @@ int main(int argc, char **argv)
show_error(wctx, ret);
}

input_ret = ret;

writer_print_section_footer(wctx);
ret = writer_close(&wctx);
if (ret < 0)
av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret));

ret = FFMIN(ret, input_ret);
}

end:
Expand Down
3 changes: 3 additions & 0 deletions libavcodec/8bps.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
unsigned char *planemap = c->planemap;
int ret;

if (buf_size < planes * height *2)
return AVERROR_INVALIDDATA;

if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;

Expand Down
8 changes: 5 additions & 3 deletions libavcodec/alac.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,15 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
avctx->bits_per_raw_sample = alac->sample_size;
avctx->sample_rate = alac->sample_rate;

if (alac->channels < 1 || alac->channels > ALAC_MAX_CHANNELS) {
if (alac->channels < 1) {
av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n");
if (avctx->ch_layout.nb_channels < 1)
return AVERROR(EINVAL);
alac->channels = avctx->ch_layout.nb_channels;
}
if (avctx->ch_layout.nb_channels > ALAC_MAX_CHANNELS || avctx->ch_layout.nb_channels <= 0 ) {
if (alac->channels > ALAC_MAX_CHANNELS) {
avpriv_report_missing_feature(avctx, "Channel count %d",
avctx->ch_layout.nb_channels);
alac->channels);
return AVERROR_PATCHWELCOME;
}
av_channel_layout_uninit(&avctx->ch_layout);
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/h263dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict,
avctx->has_b_frames = !s->low_delay;

if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
if (s->pict_type != AV_PICTURE_TYPE_B && s->mb_num/2 > get_bits_left(&s->gb))
return AVERROR_INVALIDDATA;
if (ff_mpeg4_workaround_bugs(avctx) == 1)
goto retry;
if (s->studio_profile != (s->idsp.idct == NULL))
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/hevcdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3516,7 +3516,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
}
} else {
/* verify the SEI checksum */
if (avctx->err_recognition & AV_EF_CRCCHECK && s->is_decoded &&
if (avctx->err_recognition & AV_EF_CRCCHECK && s->ref && s->is_decoded &&
s->sei.picture_hash.is_md5) {
ret = verify_md5(s, s->ref->frame);
if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) {
Expand Down
Loading

0 comments on commit a9d849e

Please sign in to comment.