mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-11-03 23:53:55 +01:00 
			
		
		
		
	Benjamin Drung's disable-dynamic-ffmpeg-v3.patch for bug 233
This commit is contained in:
		@@ -754,6 +754,10 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
 | 
			
		||||
 | 
			
		||||
bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
 | 
			
		||||
{
 | 
			
		||||
#if defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
 | 
			
		||||
   mLibsLoaded = InitLibs(wxEmptyString, showerr);
 | 
			
		||||
   return mLibsLoaded;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   wxLogMessage(wxT("Trying to load FFmpeg libraries..."));
 | 
			
		||||
   if (ValidLibsLoaded()) {
 | 
			
		||||
@@ -837,6 +841,7 @@ bool FFmpegLibs::ValidLibsLoaded()
 | 
			
		||||
 | 
			
		||||
bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
 | 
			
		||||
{
 | 
			
		||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
 | 
			
		||||
   FreeLibs();
 | 
			
		||||
 | 
			
		||||
#if defined(__WXMSW__)
 | 
			
		||||
@@ -1050,8 +1055,10 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
 | 
			
		||||
   FFMPEG_INITDYN(avutil, av_rescale_q);
 | 
			
		||||
   FFMPEG_INITDYN(avutil, avutil_version);
 | 
			
		||||
 | 
			
		||||
   //FFmpeg initialization
 | 
			
		||||
   wxLogMessage(wxT("All symbols loaded successfully. Initializing the library."));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   //FFmpeg initialization
 | 
			
		||||
   avcodec_init();
 | 
			
		||||
   avcodec_register_all();
 | 
			
		||||
   av_register_all();
 | 
			
		||||
@@ -1090,7 +1097,11 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
 | 
			
		||||
      return false;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
#if defined(DISABLE_DYNAMIC_LOADING_FFMPEG) && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 69, 0))
 | 
			
		||||
   av_register_protocol(&ufile_protocol);
 | 
			
		||||
#else
 | 
			
		||||
   av_register_protocol2(&ufile_protocol, sizeof(ufile_protocol));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   return true;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								src/FFmpeg.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/FFmpeg.h
									
									
									
									
									
								
							@@ -368,6 +368,18 @@ streamContext *import_ffmpeg_read_next_frame(AVFormatContext* formatContext,
 | 
			
		||||
 | 
			
		||||
int import_ffmpeg_decode_frame(streamContext *sc, bool flushing);
 | 
			
		||||
 | 
			
		||||
#if defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
 | 
			
		||||
   // Use the preprocessor to rename old function names instead of checking the
 | 
			
		||||
   // function names with FFMPEG_INITALT when loading the library.
 | 
			
		||||
 | 
			
		||||
   #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 60, 0)
 | 
			
		||||
   #define av_match_ext match_ext
 | 
			
		||||
   #endif
 | 
			
		||||
 | 
			
		||||
   #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 64, 0)
 | 
			
		||||
   #define av_guess_format guess_format
 | 
			
		||||
   #endif
 | 
			
		||||
#else
 | 
			
		||||
extern "C" {
 | 
			
		||||
   // A little explanation of what's going on here.
 | 
			
		||||
   //
 | 
			
		||||
@@ -900,6 +912,7 @@ extern "C" {
 | 
			
		||||
      (protocol, size)
 | 
			
		||||
   );
 | 
			
		||||
};
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif // USE_FFMPEG
 | 
			
		||||
#endif // __AUDACITY_FFMPEG__
 | 
			
		||||
 
 | 
			
		||||
@@ -87,6 +87,9 @@
 | 
			
		||||
/* Use system LAME library and disable dynamic loading of it. */
 | 
			
		||||
#undef DISABLE_DYNAMIC_LOADING_LAME
 | 
			
		||||
 | 
			
		||||
/* Use system FFmpeg library and disable dynamic loading of it. */
 | 
			
		||||
#undef DISABLE_DYNAMIC_LOADING_FFMPEG
 | 
			
		||||
 | 
			
		||||
/* Define if LADSPA plug-ins are enabled */
 | 
			
		||||
#undef USE_LADSPA
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -133,7 +133,7 @@ void LibraryPrefs::PopulateOrExchange(ShuttleGui & S)
 | 
			
		||||
         S.Id(ID_FFMPEG_DOWN_BUTTON);
 | 
			
		||||
         wxButton *bdwn = S.AddButton(_("Dow&nload"),
 | 
			
		||||
                                      wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
 | 
			
		||||
#if !defined(USE_FFMPEG)
 | 
			
		||||
#if !defined(USE_FFMPEG) || defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
 | 
			
		||||
         bdwn->Enable(FALSE);
 | 
			
		||||
         bfnd->Enable(FALSE);
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user