bring back MovieTexture_FFMpeg::RegisterProtocols

This commit is contained in:
Glenn Maynard
2005-10-29 03:25:39 +00:00
parent ac1a1e3817
commit 034c7f4a41
2 changed files with 13 additions and 7 deletions
@@ -522,15 +522,20 @@ static avcodec::URLProtocol RageProtocol =
NULL
};
void MovieTexture_FFMpeg::RegisterProtocols()
{
static bool Done = false;
if( Done )
return;
Done = true;
avcodec::av_register_all();
avcodec::register_protocol( &RageProtocol );
}
CString MovieDecoder_FFMpeg::Open( CString sFile )
{
static bool bDone = false;
if( !bDone )
{
avcodec::av_register_all();
avcodec::register_protocol( &RageProtocol );
bDone = true;
}
MovieTexture_FFMpeg::RegisterProtocols();
int ret = avcodec::av_open_input_file( &m_fctx, "rage://" + sFile, NULL, 0, NULL );
if( ret < 0 )
@@ -10,6 +10,7 @@ class MovieTexture_FFMpeg: public MovieTexture_Generic
public:
MovieTexture_FFMpeg( RageTextureID ID );
static void RegisterProtocols();
static RageSurface *AVCodecCreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor, int &iAVTexfmt );
};
#define USE_MOVIE_TEXTURE_FFMPEG