Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv: undeclared constant in f_lavfi filter channel layout #2619

Open
LigH-de opened this issue Mar 14, 2024 · 7 comments
Open

mpv: undeclared constant in f_lavfi filter channel layout #2619

LigH-de opened this issue Mar 14, 2024 · 7 comments

Comments

@LigH-de
Copy link
Contributor

LigH-de commented Mar 14, 2024

You locked the mpv repo to tag 0.36.0; maybe it's time to unlock because dependent libraries may have become incompatible?

There is an mpv PR related to "swresample: stop using deprecated {in,out}_channel_layout options" due to FFMpeg API changes.

┌ mpv git  .......................................... [Newer dependencies]
├ Running bootstrap...
├ Running configure...
├ Running build...
Likely error (tail of the failed operation logfile):
../filters/f_lavfi.c: In function 'get_avopt_type_name':
../filters/f_lavfi.c:1027:10: error: 'AV_OPT_TYPE_CHANNEL_LAYOUT' undeclared (first use in this function); did you mean 'AV_OPT_TYPE_CHLAYOUT'?
 1027 |     case AV_OPT_TYPE_CHANNEL_LAYOUT:    return "channellayout";
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |          AV_OPT_TYPE_CHLAYOUT
../filters/f_lavfi.c:1027:10: note: each undeclared identifier is reported only once for each function it appears in

Waf: Leaving directory `/build/mpv-git/build'
Build failed

logs.zip

Testing to remove the tag in media-suite_deps.sh

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 14, 2024

Using no tag or 0.37.0 does not work: there is no bootstrap.py then.

ab-suite.bootstrap.log

CPPFLAGS: 
CFLAGS: -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -mthreads
CXXFLAGS: -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1
LDFLAGS: -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++
/usr/bin/python bootstrap.py
/usr/bin/python.exe: can't open file '/build/mpv-git/bootstrap.py': [Errno 2] No such file or directory

logs.zip

@waldonnis
Copy link
Contributor

waf was removed in mpv ages ago, which is why I assume that MABS stuck with the last release to include it. I know there was a PR that started working through the issues with changing the suite to use meson so more modern versions can be built, but I'm not sure how far it got. I also started looking into it, but just haven't put much time into it so far, since it's just not a priority for me.

As for the current build issue, it's related to ffmpeg/libav changing how they handle channel layouts. You just need to apply three specific commits from upstream mpv and it'll build/work fine. Locally, I created a build/mpv_extra.sh script that contains the following (the order of patches is important):

#!/bin/bash

_post_vcs(){
    # [PATCH] filters/f_lavfi: handle removed AV_OPT_TYPE_CHANNEL_LAYOUT
    do_patch "https://github.com/mpv-player/mpv/commit/78447c4b91634aa91dcace1cc6a9805fb93b9252.patch"
    # [PATCH] filters/f_lavfi: rename channellayout to ch_layout
    do_patch "https://github.com/mpv-player/mpv/commit/414ddbd628724df3afc1e15f5e415dbb2c76a0b5.patch"
    # [PATCH] swresample: stop using deprecated {in,out}_channel_layout options
    do_patch "https://github.com/mpv-player/mpv/commit/9ef614d6a3b5e56474ec91626b06247ac60ed746.patch"
}

I can't do a PR right now or I'd submit one for this, but this should be easy to convert to something a bit more suitable for inclusion (combining them into one patch, adding it to mabs-patches, etc).

@vt-idiot
Copy link
Contributor

Those patches are unfortunately no longer enough:

21:34:15 ├ Running build...
Likely error (tail of the failed operation logfile):
../demux/demux_lavf.c:761:9: warning: 'av_stream_get_side_data' is deprecated [-Wdeprecated-declarations]
  761 |         if ((sd = av_stream_get_side_data(st, AV_PKT_DATA_DOVI_CONF, NULL))) {
      |         ^~
J:/media-autobuild_suite-master/local64/include/libavformat/avformat.h:2134:10: note: declared here
 2134 | uint8_t *av_stream_get_side_data(const AVStream *stream,
      |          ^~~~~~~~~~~~~~~~~~~~~~~

Waf: Leaving directory `/build/mpv-git/build'

@waldonnis
Copy link
Contributor

I'll be doing a build later today probably and I can't check right now, but looking over the last commit, I didn't see it include the third patch I listed (the swresample patch), so that's probably what's missing. Try a build/mpv_extra.sh containing the following to see if it helps:

#!/bin/bash

_post_vcs(){
    # [PATCH] swresample: stop using deprecated {in,out}_channel_layout options
    do_patch "https://github.com/mpv-player/mpv/commit/9ef614d6a3b5e56474ec91626b06247ac60ed746.patch"
}

@vt-idiot
Copy link
Contributor

I did all three manually myself with mpv_extra.sh, in the order you specified :/

mpv actually hasn't changed since I last built it because of the waf pin, I don't need 0.36 rebuilt lol.

@waldonnis
Copy link
Contributor

I did all three manually myself with mpv_extra.sh, in the order you specified :/

Hmm, I didn't run into this when I ran another build yesterday. I'll take a deeper look when I get more time. I may have missed a commit that didn't apply to my configuration.

mpv actually hasn't changed since I last built it because of the waf pin, I don't need 0.36 rebuilt lol.

True, lol. I keep meaning to get back to updating the suite so it uses meson when building mpv, but keep putting it off and hoping someone else will beat me to it...

@vt-idiot
Copy link
Contributor

I tried, and got pretty far using the old draft PR for it, but ended up getting stuck because of libvulkan having DllMain defined. Would more than happily keep libvulkan-1.dll next to mpv (as intended...) and get it working that way, but I couldn't figure the linker out. I think I also had to make some changes to how spirv-cross-shared-c is compiled, pretty sure I threw every single patch out and just built it with their new make system...ffmpeg still compiled just fine against that.

Signed, hoping someone smarter than me does it, because those are 8 hours I'll never get back 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants