You are not logged in.

#1 2021-04-17 13:30:34

nokangaroo
Member
Registered: 2013-09-08
Posts: 25

SOLVED Possible fix for building mplayer with ffmpeg-4.4

--- libmpcodecs/ad_spdif.c	2021-04-17 14:55:24.705032065 +0200
+++ libmpcodecs/ad_spdif.c	2021-04-17 14:54:51.084742949 +0200
@@ -300,7 +300,7 @@
         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]->info);
             av_freep(&lavf_ctx->streams[0]);
         }
         av_freep(&lavf_ctx->streams);

Can anybody confirm this? I build a rather reduced version for use with a script, and I don't use S/PDIF according to alsamixer. Anyway, mplayer seems to work with ffmpeg-4.4, but the build fails. Using "--disable-decoder=spdif --disable-encoder=spdif" does not work, same with {,de}muxer.

Last edited by nokangaroo (2021-04-17 14:21:55)

Offline

#2 2021-04-17 14:03:44

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: SOLVED Possible fix for building mplayer with ffmpeg-4.4

The correct fix should be this:

$ svn log -c r38199 svn://svn.mplayerhq.hu/mplayer/trunk
------------------------------------------------------------------------
r38199 | reimar | 2020-11-01 16:07:44 +0100 (So, 01. Nov 2020) | 4 Zeilen

ad_spdif: Use avformat_free_context to free context.

This avoids memleaks and in newest FFmpeg versions also
compile errors.
------------------------------------------------------------------------
$ svn di -c r38199 svn://svn.mplayerhq.hu/mplayer/trunk 
Index: libmpcodecs/ad_spdif.c
===================================================================
--- libmpcodecs/ad_spdif.c	(Revision 38198)
+++ 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);
 }

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2021-04-17 14:21:14

nokangaroo
Member
Registered: 2013-09-08
Posts: 25

Re: SOLVED Possible fix for building mplayer with ffmpeg-4.4

Thanks!

All I had to do was update the revision to 38199. No patch required. The package should be updated to use that revision, it is still on 38157.

Offline

Board footer

Powered by FluxBB