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

swresample: stop using deprecated {in,out}_channel_layout options #13665

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

Dudemanguy
Copy link
Member

These options were deprecated with the addition of the channel layout API about a couple of years ago*. Unfortunately, we never saw the deprecation messages so it went unnoticed until they were completely removed with the recent major version bump. Fix this by setting in_chlayout and out_chlayout instead if we have AV_CHANNEL_LAYOUT.

Fixes #13662.

*: FFmpeg/FFmpeg@8a5896e

Copy link

github-actions bot commented Mar 8, 2024

Download the artifacts for this pull request:

Windows
macOS

Copy link
Contributor

@kasper93 kasper93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for consistency with upstream naming, should probably change

diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c
index de3cd52a2a..555d6f1c21 100644
--- a/filters/f_lavfi.c
+++ b/filters/f_lavfi.c
@@ -1037,7 +1037,7 @@ static const char *get_avopt_type_name(enum AVOptionType type)
 #if LIBAVUTIL_VERSION_MAJOR < 59
     case AV_OPT_TYPE_CHANNEL_LAYOUT:    return "channellayout";
 #else
-    case AV_OPT_TYPE_CHLAYOUT:          return "channellayout";
+    case AV_OPT_TYPE_CHLAYOUT:          return "ch_layout";
 #endif
     case AV_OPT_TYPE_BOOL:              return "bool";
     case AV_OPT_TYPE_CONST: // fallthrough

filters/f_swresample.c Outdated Show resolved Hide resolved
filters/f_swresample.c Outdated Show resolved Hide resolved
These options were deprecated with the addition of the channel layout
API about a couple of years ago*. Unfortunately, we never saw the
deprecation messages so it went unnoticed until they were completely
removed with the recent major version bump. Fix this by setting
in_chlayout and out_chlayout instead if we have AV_CHANNEL_LAYOUT.

Fixes mpv-player#13662.

*: FFmpeg/FFmpeg@8a5896e
@Dudemanguy
Copy link
Member Author

Also for consistency with upstream naming, should probably change

This is only ever used for help output. Could change if you want to, but probably it would be better to keep it consistent across all versions (i.e. either ch_layout or channellayout)?

@kasper93
Copy link
Contributor

kasper93 commented Mar 8, 2024

This is only ever used for help output. Could change if you want to, but probably it would be better to keep it consistent across all versions (i.e. either ch_layout or channellayout)?

I think ch_layout is good.

To better match upstream naming.
@Dudemanguy
Copy link
Member Author

I think ch_layout is good.

Alright went with that.

@Dudemanguy Dudemanguy merged commit 414ddbd into mpv-player:master Mar 8, 2024
14 checks passed
@Dudemanguy Dudemanguy deleted the swresample-update branch March 8, 2024 22:55
@providence94
Copy link

hey I have this issue in my mpv installed through homebrew
how can I get this new change
I have version - 0.37.0_2

@cattyhouse
Copy link

i am also having this issue on macOS since homebrew upgraded ffmpeg to 7.0. Can you make a release of the mpv formula (home brew call command line programs formula)?

@cattyhouse
Copy link

hey I have this issue in my mpv installed through homebrew how can I get this new change I have version - 0.37.0_2

i fixed this by building from source, steps:

  • brew unlink mpv
  • brew install --HEAD mpv

after building, mpv --version :

mpv v0.37.0-766-ge42a8d537f Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Apr 12 2024 21:23:16
libplacebo version: v6.338.2
FFmpeg version: 7.0
FFmpeg library versions:
   libavutil       59.8.100
   libavcodec      61.3.100
   libavformat     61.1.100
   libswscale      8.1.100
   libavfilter     10.1.100
   libswresample   5.1.100

@cattyhouse
Copy link

@sfan5 @Dudemanguy

Could you make a new mpv release to solve this issue for macOS users?

Since homebrew upgraded ffpmeg 7.0 on April 9th, this issue starts to show up on macOS when playing .mkv files, no audio.

building from source works, but that will build every time when mpv has a new commit when running brew upgrade, which is a bit tough for end users. thank you.

@kasper93
Copy link
Contributor

kasper93 commented Apr 13, 2024

Report it to them, not here. Not our fault they ship broken packages or build formulas. mpv 0.38 will be released, but it is completely unrelated to the issues you are facing.

They already patch 0.37 mpv as it doesn't even build with ffmpeg 7. This PR should also be included.

See https://github.com/Homebrew/homebrew-core/blob/c7106fbd47ddf6ec976b22924f05309720bd3079/Formula/m/mpv.rb#L12-L22

@ZhongRuoyu
Copy link

Sorry for the trouble. Homebrew users can run brew update && brew upgrade mpv to get a fix for this.

@kasper93
Copy link
Contributor

Thanks for fixing this.

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

Successfully merging this pull request may close these issues.

FFmpeg Channel Layout Changes Break Audio Output With video-sync=display-resample
6 participants