From 960cd687732f92737d2dff931348b138330be643 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Sat, 15 May 2021 16:52:25 +1000 Subject: [PATCH] mplayer: fix build failure with ffmpeg 4.4 Backport SVN revision 38199. --- pkgs/applications/video/mplayer/default.nix | 2 ++ .../mplayer/svn-r38199-ffmpeg44fix.patch | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 0162a999709..b6bfa9d0dcf 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -106,6 +106,8 @@ stdenv.mkDerivation rec { rm -rf ffmpeg ''; + patches = [ ./svn-r38199-ffmpeg44fix.patch ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ pkg-config yasm ]; buildInputs = with lib; diff --git a/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch b/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch new file mode 100644 index 00000000000..4137989fcb5 --- /dev/null +++ b/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch @@ -0,0 +1,22 @@ +Index: libmpcodecs/ad_spdif.c +=================================================================== +diff --git a/libmpcodecs/ad_spdif.c b/libmpcodecs/ad_spdif.c +--- a/libmpcodecs/ad_spdif.c (revision 38198) ++++ b/libmpcodecs/ad_spdif.c (revision 38199) +@@ -298,14 +298,8 @@ + if (spdif_ctx->header_written) + av_write_trailer(lavf_ctx); + av_freep(&lavf_ctx->pb); +- if (lavf_ctx->streams) { +- av_freep(&lavf_ctx->streams[0]->codec); +- av_freep(&lavf_ctx->streams[0]->info); +- av_freep(&lavf_ctx->streams[0]); +- } +- av_freep(&lavf_ctx->streams); +- av_freep(&lavf_ctx->priv_data); ++ avformat_free_context(lavf_ctx); ++ lavf_ctx = NULL; + } +- av_freep(&lavf_ctx); + av_freep(&spdif_ctx); + }