initialize libavcodec on startup

Originally committed to SVN as r327.
This commit is contained in:
David Lamparter 2006-04-14 22:36:07 +00:00
parent f1f8b556bf
commit 1519ee5ce6
3 changed files with 14 additions and 7 deletions

View file

@ -38,6 +38,13 @@
#ifdef USE_LAVC #ifdef USE_LAVC
LAVCFile::Initializer LAVCFile::init;
LAVCFile::Initializer::Initializer()
{
av_register_all();
}
LAVCFile::LAVCFile(wxString filename) LAVCFile::LAVCFile(wxString filename)
{ {
int result = 0; int result = 0;

View file

@ -48,6 +48,13 @@ private:
LAVCFile(wxString filename); LAVCFile(wxString filename);
~LAVCFile(); ~LAVCFile();
class Initializer {
public:
Initializer();
};
static Initializer init;
public: public:
AVFormatContext *fctx; AVFormatContext *fctx;

View file

@ -62,13 +62,6 @@ LAVCVideoProvider::LAVCVideoProvider(wxString filename, wxString subfilename) {
zoom = 1.0; zoom = 1.0;
validFrame = false; validFrame = false;
// Register types
static bool avRegistered = false;
if (!avRegistered) {
av_register_all();
avRegistered = true;
}
// Load // Load
LoadVideo(filename); LoadVideo(filename);
} }