mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-10-31 06:03:49 +01:00 
			
		
		
		
	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:
		| @@ -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.")); | ||||
|   | ||||
| @@ -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)                                             \ | ||||
|       {                                                                 \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user