[Cin] Mplayer2 compilation

Andrew Randrianasulu randrianasulu at gmail.com
Tue Aug 9 23:22:01 CEST 2022


So, I tried to test my suggestion and try mplayer2's gl3 output (with icc /
lcms2 support)

I run into obvious barrier of ffmpeg API changes.
For easy install I just cloned mplayer2 code from github first

git clone https://github.com/astiob/mplayer2.git

Then downloaded ffmpeg 2.3.6 tar.bz2 unpacked and configured it on 32 bit
system like this

# ./configure --disable-debug --disable-asm --disable-doc
--enable-avresample

May be you can leave asm enabled on 64 bit x86-64 system, for me it failed
in h264 header.

Then I installed this ffmpeg to default /usr/local prefix

Then I configured mplayer2 without sdl:

./configure --disable-sdl

And then I run into problem ...for some reason any ffmpeg decoded video was
failing to init vo .. even  null vo!

I finally guessed there was missing {} pair ...

After patching mplayer2 sources with attached patch I finally got output!

I also slightly enlarged help text array, so

-vo gl3:help will not truncated in the middle ...

Note, by default mplayer2 binary still named mplayer, so please do not
install this mplayer over system provided one, just run it from its source
dir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20220810/b8c79705/attachment.htm>
-------------- next part --------------
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 539a8747f..ab096ed1f 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -509,18 +509,22 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt)
         sh->disp_h = height;
         ctx->pix_fmt = pix_fmt;
         ctx->best_csp = pixfmt2imgfmt(pix_fmt);
+        
         const unsigned int *supported_fmts;
-        if (ctx->best_csp == IMGFMT_YV12)
+        if(ctx->best_csp == 0)
+        printf("argh!\n");
+        
+        if (ctx->best_csp == IMGFMT_YV12) {
             supported_fmts = (const unsigned int[]){
                 IMGFMT_YV12, IMGFMT_I420, IMGFMT_IYUV, 0xffffffff
-            };
+            }; printf ("yv12\n"); }
         else if (ctx->best_csp == IMGFMT_422P)
             supported_fmts = (const unsigned int[]){
                 IMGFMT_422P, IMGFMT_YV12, IMGFMT_I420, IMGFMT_IYUV, 0xffffffff
             };
         else
             supported_fmts = (const unsigned int[]){ctx->best_csp, 0xffffffff};
-
+	
         sh->color_primaries = avcol_pri_to_mp_cprim(avctx->color_primaries);
         sh->colorspace = avcol_spc_to_mp_csp(avctx->colorspace);
         sh->color_range = avcol_range_to_mp_csp_levels(avctx->color_range);
diff --git a/libvo/vo_gl3.c b/libvo/vo_gl3.c
index b4886a0d2..5ff838a0d 100644
--- a/libvo/vo_gl3.c
+++ b/libvo/vo_gl3.c
@@ -2567,7 +2567,7 @@ const struct vo_driver video_out_gl3 = {
     .uninit = uninit,
 };
 
-static const char help_text[] =
+static const char help_text[8048] =
 "\n--vo=gl3 command line help:\n"
 "Example: mplayer --vo=gl3:scale-sep:lscale=lanczos2\n"
 "\nOptions:\n"
diff --git a/mp_msg.c b/mp_msg.c
index eea65671d..04edf0575 100644
--- a/mp_msg.c
+++ b/mp_msg.c
@@ -38,7 +38,7 @@
 #include "mp_msg.h"
 
 /* maximum message length of mp_msg */
-#define MSGSIZE_MAX 3072
+#define MSGSIZE_MAX 7200
 
 #ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN


More information about the Cin mailing list