Skip to content

Conversation

ulmus-scott
Copy link
Contributor

This complements #1155 by removing the uses of compat.h in libmythdvdnav.

This is preliminary work for updating libmythdvdnav and can be merged separately if desired.

This also enables configure to find libdvdcss via pkg-config and also converts CMake to use pkg-config.

Checklist

@ulmus-scott ulmus-scott force-pushed the config_h branch 2 times, most recently from 76360d3 to 259e551 Compare July 27, 2025 20:21
@ulmus-scott ulmus-scott changed the title Remove uses of compat.h in libmythdvdnav and have configure create libmythdvnav/config.h Remove uses of compat.h in libmythdvdnav and have configure create libmythdvdnav/config.h Jul 27, 2025
@ulmus-scott
Copy link
Contributor Author

It should be noted that libmythdvdnav's config.h file probably also needs to be installed when compiling with MSVC, but I don't know how a native Windows build with MSVC works and neither libdvdread nor libdvdnav appear to install their config.hs.

@jhoyt4
Copy link
Contributor

jhoyt4 commented Aug 1, 2025

it looks like both macports and homebrew can find libdvdcss with pkg-config, but when building with cmake neither can find it

% pkg-config --list-all|grep dvdcss
libdvdcss libdvdcss - DVD access and decryption library.

Found in the cmake output message:
-- Looking for dvdcss/dvdcss.h -- Looking for dvdcss/dvdcss.h - not found

And sadly not dynamically linked by cmake
otool -L ~/mythtv-36/36-osx-64bit/lib/libmythdvdnav.36-36.dylib
/Users/jhoyt/mythtv-36/36-osx-64bit/lib/libmythdvdnav.36-36.dylib:
@rpath/libmythdvdnav.36-36.dylib (compatibility version 36.0.0, current version 36.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1900.180.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

@jhoyt4
Copy link
Contributor

jhoyt4 commented Aug 1, 2025

it looks like both macports and homebrew can find libdvdcss with pkg-config, but when building with cmake neither can find it

strike that - it helps to use the right branch...

macports and homebrew both picked up ibdvdcss. I'll test once the apss get through notarization.

macports:

% otool -L 36-osx-64bit/lib/libmythdvdnav.36-36.dylib 
36-osx-64bit/lib/libmythdvdnav.36-36.dylib:
   @rpath/libmythdvdnav.36-36.dylib (compatibility version 36.0.0, current version 36.0.0)
   /opt/local/lib/libdvdcss.2.dylib (compatibility version 5.0.0, current version 5.0.0)
   /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1900.180.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

homebrew:

otool -L lib/libmythdvdnav.36-36.dylib
lib/libmythdvdnav.36-36.dylib:
	@rpath/libmythdvdnav.36-36.dylib (compatibility version 36.0.0, current version 36.0.0)
	/opt/homebrew/opt/libdvdcss/lib/libdvdcss.2.dylib (compatibility version 5.0.0, current version 5.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1900.180.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

@jhoyt4
Copy link
Contributor

jhoyt4 commented Aug 1, 2025

tested and verified to work with a physical dvd on macOS

@ulmus-scott
Copy link
Contributor Author

Should I remove the customization for dynamically loading libdvdcss on macOS since it is not compiled when libdvdcss is found via pkg-config?

@jhoyt4
Copy link
Contributor

jhoyt4 commented Aug 1, 2025

I'd suggest yes. I was planning on deprecating the qmake macOS compile script in the next release so removing the dynamic linking work around would clean up / simplify the code base.

The removed comment was wrong and the surrounding
lines deal with MythTV's customizations to use code from
libmythtv, so extract lines not related to those customizations.
Upstream libdvdread already used a version.h and upstream
libdvdnav added one since our last synchronization.
The only difference with libdvdread's version
is snprinf() is now used instead of _snprintf(),
but this produces no change since errstr in dlerror() is larger than
the maximum possible string produced by the use of snprintf().

The extra config.h lines are from libdvdread's msvc/config.h.
This is a boolean, but libdvdnav doesn't use _Bool or bool.
There are no substitutions compat.h would now make.
This reduces the changes versus upstream and reduces files
included from MythTV.

This also allows libmythdvdnav to dynamically link instead of
dynamically load libdvdcss with qmake.
pkg-config is now used instead to enable dynamic linking.

This was from:
Search for the region decrypting library in Mac OS X bundles. A little ugly
MythTV@03b8c7d

Look in more than one location for libdvdcss on mac.
MythTV@18fdd67
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.

2 participants