initialize libavcodec on startup
Originally committed to SVN as r327.
This commit is contained in:
parent
f1f8b556bf
commit
1519ee5ce6
3 changed files with 14 additions and 7 deletions
|
@ -38,6 +38,13 @@
|
|||
|
||||
#ifdef USE_LAVC
|
||||
|
||||
LAVCFile::Initializer LAVCFile::init;
|
||||
|
||||
LAVCFile::Initializer::Initializer()
|
||||
{
|
||||
av_register_all();
|
||||
}
|
||||
|
||||
LAVCFile::LAVCFile(wxString filename)
|
||||
{
|
||||
int result = 0;
|
||||
|
|
|
@ -48,6 +48,13 @@ private:
|
|||
|
||||
LAVCFile(wxString filename);
|
||||
~LAVCFile();
|
||||
|
||||
class Initializer {
|
||||
public:
|
||||
Initializer();
|
||||
};
|
||||
static Initializer init;
|
||||
|
||||
public:
|
||||
AVFormatContext *fctx;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue