Attached patch allows audacity to runtime detect match_ext() vs av_match_ext().

Audacity compiled with this patch against FFmpeg 0.5 will still have
problems with AVPacket and AVFifo API issues that they have put behind
"#if FFMPEG_STABLE"
Index: src/FFmpeg.h
===================================================================
--- a/src/FFmpeg.h	(revision 10632)
+++ b/src/FFmpeg.h	(working copy)
@@ -63,6 +63,7 @@
 
 /* These defines apply whether or not ffmpeg is available */
 #define INITDYN(w,f) if ((*(void**)&this->f=(void*)w->GetSymbol(wxT(#f))) == NULL) { wxLogMessage(wxT("Failed to load symbol ") wxT(#f)); return false; };
+#define INITDYN2(w,f,f2) if ((*(void**)&this->f=(void*)w->GetSymbol(wxT(#f2))) == NULL) { INITDYN(w,f) };
 
 /// Callback function to catch FFmpeg log messages.
 /// Uses wxLogMessage.
Index: src/FFmpeg.cpp
===================================================================
--- a/src/FFmpeg.cpp	(revision 10632)
+++ b/src/FFmpeg.cpp	(working copy)
@@ -828,7 +828,7 @@
    INITDYN(avformat,av_open_input_file);
    INITDYN(avformat,av_open_input_stream);
    INITDYN(avformat,get_buffer);
-   INITDYN(avformat,match_ext);
+   INITDYN2(avformat,match_ext,av_match_ext);
 
 #if FFMPEG_STABLE
    INITDYN(avformat,av_init_packet);

Reply via email to