Package: mplayer
Version:2:1.4+ds1-1

When MPlayer (v. 2:1.4+ds1-1) is compiled with FFMPEG 4.4-5 (now in bookworm/sid) compilation fails. Log:

In file included from libmpcodecs/ad_spdif.c:25:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:888:21: note: declared here
  888 | AVCodecContext *codec;
      | ^~~~~
libmpcodecs/ad_spdif.c:303:43: error: 'AVStream' {aka 'struct AVStream'} has no member named 'info'
  303 | av_freep(&lavf_ctx->streams[0]->info);
      | ^~
make[2]: *** [Makefile:726: libmpcodecs/ad_spdif.o] Error 1
make[2]: *** Waiting for unfinished jobs....

The patch in attachment (proposed here: https://bbs.archlinux.org/viewtopic.php?id=265578 <https://bbs.archlinux.org/viewtopic.php?id=265578>) fix the issue.

I am using Ubuntu 20.04, kernel 5.11.0-34-generic and libc6 2.31-0ubuntu9.
diff -Nru MPlayer-1.4.orig/libmpcodecs/ad_spdif.c 
MPlayer-1.4/libmpcodecs/ad_spdif.c
--- MPlayer-1.4.orig/libmpcodecs/ad_spdif.c     2016-03-06 08:00:49.000000000 
-0500
+++ MPlayer-1.4/libmpcodecs/ad_spdif.c  2021-09-09 10:22:49.000000000 -0400
@@ -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);
 }

Reply via email to