MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
636 stars 176 forks source link

Seems to be an extra argument in gvPluginList #2143

Closed bassmadrigal closed 1 week ago

bassmadrigal commented 1 week ago

I tried building libmediainfo 24.11 on Slackware 15.0 and ran into the following error:

libtool: compile:  g++ -DPACKAGE_NAME=\"libmediainfo\" -DPACKAGE_TARNAME=\"libmediainfo\" -DPACKAGE_VERSION=\"24.11\" "-DPACKAGE_STRING=\"libmediainfo 24.11\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmediainfo\" -DVERSION=\"24.11\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ZLIB_H=1 -I. -I../../../Source -I../../../../ZenLib/Source -std=c++11 -O2 -fPIC -DUNICODE -DSIZE_T_IS_LONG -I/usr/include/graphviz -I/usr/local/include -I/usr/include/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../../../Source/ThirdParty/aes-gladman -I../../../Source/ThirdParty/md5 -I../../../Source/ThirdParty/sha1-gladman -I../../../Source/ThirdParty/sha2-gladman -I../../../Source/ThirdParty/hmac-gladman -I../../../Source/ThirdParty/base64 -DUNICODE -fPIC -O2 -fvisibility=hidden -fvisibility-inlines-hidden -MT ../../../Source/MediaInfo/Image/File_Psd.lo -MD -MP -MF ../../../Source/MediaInfo/Image/.deps/File_Psd.Tpo -c ../../../Source/MediaInfo/Image/File_Psd.cpp  -fPIC -DPIC -o ../../../Source/MediaInfo/Image/.libs/File_Psd.o
../../../Source/MediaInfo/Export/Export_Graph.cpp: In function ‘ZenLib::Ztring MediaInfoLib::Dot2Svg(const ZenLib::Ztring&)’:
../../../Source/MediaInfo/Export/Export_Graph.cpp:133:34: error: too many arguments to function ‘char** gvPluginList(GVC_t*, const char*, int*)’
  133 |     char** Renderers=gvPluginList(Context, "render", &Renderers_Size, NULL);
      |                      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../Source/MediaInfo/Export/Export_Graph.cpp:35:
/usr/include/graphviz/gvc.h:120:16: note: declared here
  120 | GVC_API char **gvPluginList(GVC_t *gvc, const char *kind, int *sz);
      |                ^~~~~~~~~~~~

Upon looking at the commit history for Source/Mediainfo/Export/Export_Graph.cpp, I found the 594c6f4 commit. In looking at the gvPluginList function and comparing it to the typedef line in Export_Graph_gvc_Include.h that was added in the same commit, it seems it gvPluginList should only have 3 arguments, not 4 (or the typedef line should be changed to have 4 arguments, but I am not much of a programmer to know better). When I removed the NULL argument, the source was able to compile successfully.

Since Slackware uses a bash script to build packages, I simply added a sed line to the script to remove the NULL argument.

sed -i 's|Renderers_Size, NULL|Renderers_Size|' Source/MediaInfo/Export/Export_Graph.cpp

MediaInfo itself was then updated to 24.11 and all seem to work fine with several test files using both the CLI and GUI.