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

libav: libvpx >= 1.8 drops some formats #111172

Merged
merged 1 commit into from Jan 30, 2021
Merged

libav: libvpx >= 1.8 drops some formats #111172

merged 1 commit into from Jan 30, 2021

Conversation

twhitehead
Copy link
Contributor

Motivation for this change

The recent upgrade of libvpx to 1.8/1.9 broke libav_12.

nix build nixpkgs.libav_12
...
  libavcodec/libvpx.c:66:42: error: 'VPX_IMG_FMT_RGB555_LE' undeclared (first use in this function); did you mean 'AV_PIX_FMT_RGB555LE'?
     66 |     case AV_PIX_FMT_RGB555LE:     return VPX_IMG_FMT_RGB555_LE;
        |                                          ^~~~~~~~~~~~~~~~~~~~~
        |                                          AV_PIX_FMT_RGB555LE
  libavcodec/libvpx.c:70:42: error: 'VPX_IMG_FMT_444A' undeclared (first use in this function); did you mean 'VPX_IMG_FMT_I440'?
     70 |     case AV_PIX_FMT_YUVA444P:     return VPX_IMG_FMT_444A;
        |                                          ^~~~~~~~~~~~~~~~
        |                                          VPX_IMG_FMT_I440
  make: *** [Makefile:48: libavcodec/libvpx.o] Error 1
  make: *** Waiting for unfinished jobs....

The issue, as can seen above, is that some libvpx has dropped some of its previously supported formats. The effected code just converts VPX image format constants to AV image format constants, and the solution, as found in this patch here is to simply #if out the conversion lines for the dropped formats when building against the newer libvpx.

This simply results in the case falling through to the default none format constants and follows the existing #if statements found in the code for differences in various other versions of libvpx.

This pull request adds the referenced patch for libav_12. It is applied unconditionally to libav_12 as libvpx <= 1.7 (the ones that had the dropped formats) were removed with the libvpx upgrade that causes this issue.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 111172 run on x86_64-darwin 1

1 package marked as broken and skipped:
  • libav_12

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 111172 run on x86_64-linux 1

2 packages built:
  • libav_12
  • untrunc

@twhitehead
Copy link
Contributor Author

CCing @Ericson2314 @vcunat as recent commiters from the git log as this simple fix will probably go nowhere without some actual people.

@SuperSandro2000
Copy link
Member

without some actual people.

I am a real person and already took a look at the diff but I can't really tell if the patch is good or not.

@twhitehead
Copy link
Contributor Author

Thank @SuperSandro2000. Sorry for having thought you were a bot. 😀

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

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

Exactly the same patch had been filed upstream, and it seems correct to me (and very unlikely to break anything). By the way, the libav project appears quite dead for years...

@vcunat vcunat merged commit 1c12fe6 into NixOS:master Jan 30, 2021
@twhitehead
Copy link
Contributor Author

Thanks. I was using it because it was listed as a requirement of ovito a couple of years ago when I first packaged it (I filed this bug in order to submit the ovito package). After your message, I looked into it, and I see it was switched to ffmpeg last year. I'll update and switch it over. 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants