Relative to Bug 3577137
metadata.c #includes the headers for ffmpeg libavutil (avutil.h), libavformat (avformat.h) and libavcodec (avcodec.h). By GCC command argument trickery, the current minidlna (v1.0.25) places specific ffmpeg-related include directories ahead of the system directories in the search path, in order to satisfy the metadata.c requirements with simple, unqualified system includes. However, this trickery causes compile errors in minidlna.c, when the compiler retrieves ffmpeg-related headers /instead of/ the expected system headers (i.e. time.h). See bug 3577137
Suggest that the config.h generation logic in genconfig.sh be improved to properly locate the relevant ffmpeg headers, and build #defines in config.h pointing to them. This way, metadata.c can use the preprocessor-token version of the #include to grab the proper headers.
genconfig.sh generates the following lines in config.h
#define AVUTIL <ffmpeg/avutil.h>
#define AVFORMAT <ffmpeg/avformat.h>
#define AVCODEC <ffmpeg/avcodec.h>
Attached file contains a script that can build the relevant config.h entries. Note that the presented script is not complete; when more than one matching header is found in the system include directories, the script may select the wrong header for use:
~ $ rm config.h
~ $ . avheaders.sh
Found multiple avcodec.h headers in the standard include libraries.
Using first one found: libavfilter/avcodec.h
~ $ cat config.h
#define AVUTIL <libavutil/avutil.h>
#define AVFORMAT <libavformat/avformat.h>
#define AVCODEC <libavfilter/avcodec.h>
NB: Both /usr/include and /usr/local/include header directories are searched for relevant headers. In my case, ffmpeg is installed in /usr/local, not /usr (as per standards, as this ffmpeg is a locally compiled implementation, rather than a distribution-supplied implementation).
Log in to post a comment.