1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Use SDL_RWops for video loading

It should fix Android video support. For emscripten
it's still not working.
This commit is contained in:
Mathieu Schroeter 2018-07-20 22:43:13 +02:00
parent 561469f4fd
commit c8a0a42e62
2 changed files with 7 additions and 1 deletions

View File

@ -79,6 +79,7 @@ CMovie::fileCloseMovie ()
if (m_movie)
{
Kit_CloseSource (m_movie);
SDL_RWclose (this->rw_ops);
m_movie = nullptr;
}
}
@ -98,9 +99,13 @@ CMovie::fileOpenMovie (const std::string & pFilename)
if (m_fMovieOpen)
fileCloseMovie ();
this->rw_ops = SDL_RWFromFile (path.c_str (), "rb");
if (!this->rw_ops)
return false;
// Open up the sourcefile.
// This can be a local file, network url, ...
m_movie = Kit_CreateSourceFromUrl (path.c_str ());
m_movie = Kit_CreateSourceFromRW (rw_ops);
if (m_movie)
{
// Create the player

View File

@ -57,6 +57,7 @@ protected:
SDL_Texture * m_videoTex;
Sint32 m_ret;
SDL_AudioDeviceID m_audioDev;
SDL_RWops * rw_ops;
char m_audiobuf[AUDIOBUFFER_SIZE];
bool m_bEnable;