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
LAVCFile::Initializer LAVCFile::init;
LAVCFile::Initializer::Initializer()
{
av_register_all();
}
LAVCFile::LAVCFile(wxString filename)
{
int result = 0;

View File

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

View File

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