FFmpeg: Modify FFMPEG_INITALT to support loading from a different alternative library.

av_frame_alloc/av_frame_free are defined in avutil, but the deprecated
alternative functions avcodec_alloc_frame/avcodec_free_frame are defined in
avcodec instead. FFMPEG_INITALT needs to be enhanced to support different
library names.
This commit is contained in:
benjamin.drung@gmail.com 2014-06-10 21:18:50 +00:00
parent a12818a912
commit caf557a614
2 changed files with 5 additions and 5 deletions

View File

@ -870,7 +870,7 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool WXUNUSED(showerr))
FFMPEG_INITDYN(avformat, avformat_open_input);
FFMPEG_INITDYN(avformat, avio_size);
FFMPEG_INITDYN(avformat, avio_alloc_context);
FFMPEG_INITALT(avformat, av_guess_format, guess_format);
FFMPEG_INITALT(avformat, av_guess_format, avformat, guess_format);
FFMPEG_INITDYN(avcodec, av_init_packet);
FFMPEG_INITDYN(avcodec, av_free_packet);
@ -903,8 +903,8 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool WXUNUSED(showerr))
FFMPEG_INITDYN(avutil, av_freep);
FFMPEG_INITDYN(avutil, av_rescale_q);
FFMPEG_INITDYN(avutil, avutil_version);
FFMPEG_INITALT(avutil, av_frame_alloc, avcodec_alloc_frame);
FFMPEG_INITALT(avutil, av_frame_free, avcodec_free_frame);
FFMPEG_INITALT(avutil, av_frame_alloc, avcodec, avcodec_alloc_frame);
FFMPEG_INITALT(avutil, av_frame_free, avcodec, avcodec_free_frame);
FFMPEG_INITDYN(avutil, av_samples_get_buffer_size);
wxLogMessage(wxT("All symbols loaded successfully. Initializing the library."));

View File

@ -509,7 +509,7 @@ extern "C" {
return false; \
}
#define FFMPEG_INITALT(w, f, a) \
#define FFMPEG_INITALT(w, f, x, a) \
{ \
wxLogNull off; \
*(void**)&f ## _fp = (void*)w->GetSymbol(wxT(#f)); \
@ -518,7 +518,7 @@ extern "C" {
{ \
{ \
wxLogNull off; \
*(void**)&f ## _fp = (void*)w->GetSymbol(wxT(#a)); \
*(void**)&f ## _fp = (void*)x->GetSymbol(wxT(#a)); \
} \
if (f ## _fp == NULL) \
{ \