bring back MovieTexture_FFMpeg::RegisterProtocols
This commit is contained in:
@@ -522,15 +522,20 @@ static avcodec::URLProtocol RageProtocol =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
CString MovieDecoder_FFMpeg::Open( CString sFile )
|
void MovieTexture_FFMpeg::RegisterProtocols()
|
||||||
{
|
{
|
||||||
static bool bDone = false;
|
static bool Done = false;
|
||||||
if( !bDone )
|
if( Done )
|
||||||
{
|
return;
|
||||||
|
Done = true;
|
||||||
|
|
||||||
avcodec::av_register_all();
|
avcodec::av_register_all();
|
||||||
avcodec::register_protocol( &RageProtocol );
|
avcodec::register_protocol( &RageProtocol );
|
||||||
bDone = true;
|
}
|
||||||
}
|
|
||||||
|
CString MovieDecoder_FFMpeg::Open( CString sFile )
|
||||||
|
{
|
||||||
|
MovieTexture_FFMpeg::RegisterProtocols();
|
||||||
|
|
||||||
int ret = avcodec::av_open_input_file( &m_fctx, "rage://" + sFile, NULL, 0, NULL );
|
int ret = avcodec::av_open_input_file( &m_fctx, "rage://" + sFile, NULL, 0, NULL );
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class MovieTexture_FFMpeg: public MovieTexture_Generic
|
|||||||
public:
|
public:
|
||||||
MovieTexture_FFMpeg( RageTextureID ID );
|
MovieTexture_FFMpeg( RageTextureID ID );
|
||||||
|
|
||||||
|
static void RegisterProtocols();
|
||||||
static RageSurface *AVCodecCreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor, int &iAVTexfmt );
|
static RageSurface *AVCodecCreateCompatibleSurface( int iTextureWidth, int iTextureHeight, bool bPreferHighColor, int &iAVTexfmt );
|
||||||
};
|
};
|
||||||
#define USE_MOVIE_TEXTURE_FFMPEG
|
#define USE_MOVIE_TEXTURE_FFMPEG
|
||||||
|
|||||||
Reference in New Issue
Block a user