Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 130
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20161230.0848 +Version: 0.7.2.99+git20170104.1157 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/CMakeLists.txt
Changed
@@ -210,8 +210,6 @@ ENDIF() PACK_EXECUTABLE(lightspark) - INSTALL(FILES ${PROJECT_SOURCE_DIR}/src/lightspark.frag DESTINATION ${LSDATADIR}) - INSTALL(FILES ${PROJECT_SOURCE_DIR}/src/lightspark.vert DESTINATION ${LSDATADIR}) INSTALL(TARGETS lightspark RUNTIME DESTINATION ${BINDIR}) IF(UNIX) INSTALL(FILES ${PROJECT_SOURCE_DIR}/docs/man/lightspark.1 DESTINATION ${MANUAL_DIRECTORY}/man1/)
View file
lightspark.tar.xz/src/backends/audio.cpp
Changed
@@ -124,10 +124,13 @@ AudioManager::AudioManager():muteAllStreams(false),sdl_available(0),mixeropened(0) { sdl_available = 0; - if (SDL_WasInit(0)) // some part of SDL already was initialized - sdl_available = !SDL_InitSubSystem ( SDL_INIT_AUDIO ); - else - sdl_available = !SDL_Init ( SDL_INIT_AUDIO ); + if (EngineData::sdl_needinit) + { + if (SDL_WasInit(0)) // some part of SDL already was initialized + sdl_available = !SDL_InitSubSystem ( SDL_INIT_AUDIO ); + else + sdl_available = !SDL_Init ( SDL_INIT_AUDIO ); + } mixeropened = 0; } void AudioManager::muteAll()
View file
lightspark.tar.xz/src/backends/config.cpp
Changed
@@ -121,21 +121,21 @@ #endif //If cache dir doesn't exist, create it - path cacheDirectoryP(cacheDirectory); - if(!is_directory(cacheDirectoryP)) + try { - LOG(LOG_INFO, "Cache directory does not exist, trying to create"); - try + path cacheDirectoryP(cacheDirectory); + if(!is_directory(cacheDirectoryP)) { - create_directories(cacheDirectoryP); - } - catch(const filesystem_error& e) - { - LOG(LOG_INFO, _("Could not create cache directory, falling back to default cache directory: ") << - defaultCacheDirectory); - cacheDirectory = defaultCacheDirectory; + LOG(LOG_INFO, "Cache directory does not exist, trying to create"); + create_directories(cacheDirectoryP); } } + catch(const filesystem_error& e) + { + LOG(LOG_INFO, _("Could not create cache directory, falling back to default cache directory: ") << + defaultCacheDirectory); + cacheDirectory = defaultCacheDirectory; + } #ifdef _WIN32 std::string regGnashPath = readRegistryEntry("GnashPath");
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -1076,6 +1076,7 @@ //NOTE: in FFMpeg 0.7 there is av_probe_input_buffer AVProbeData probeData; probeData.filename="lightspark_stream"; + probeData.mime_type=NULL; probeData.buf=new uint8_t[8192+AVPROBE_PADDING_SIZE]; memset(probeData.buf,0,8192+AVPROBE_PADDING_SIZE); stream.read((char*)probeData.buf,8192); @@ -1083,7 +1084,7 @@ if(read!=8192) LOG(LOG_ERROR,"Not sufficient data is available from the stream:"<<read); probeData.buf_size=read; - + stream.seekg(0); fmt=av_probe_input_format(&probeData,1); delete[] probeData.buf; @@ -1154,7 +1155,7 @@ if(audioFound) { - if (format) + if (format && (format->codec != LS_AUDIO_CODEC::CODEC_NONE)) customAudioDecoder=new FFMpegAudioDecoder(format->codec,format->sampleRate,format->channels,true); else #if LIBAVFORMAT_VERSION_MAJOR > 56
View file
lightspark.tar.xz/src/backends/extscriptobject.cpp
Changed
@@ -377,9 +377,9 @@ if(!synchronous) { func->incRef(); - funcEvent = _MR(new (getSys()->unaccountedMemory) ExternalCallEvent(_MR(func), asArgs, argc, &result, &exceptionThrown, &exception)); + funcEvent = _MR(new (func->getSystemState()->unaccountedMemory) ExternalCallEvent(_MR(func), asArgs, argc, &result, &exceptionThrown, &exception)); // Add the callback function event to the VM event queue - funcWasCalled=getVm(getSys())->addEvent(NullRef,funcEvent); + funcWasCalled=getVm(func->getSystemState())->addEvent(NullRef,funcEvent); if(!funcWasCalled) funcEvent = NullRef; }
View file
lightspark.tar.xz/src/backends/rendering.cpp
Changed
@@ -276,15 +276,11 @@ //Create render program uint32_t f = engineData->exec_glCreateShader_GL_FRAGMENT_SHADER(); - const char *fs = NULL; - fs = dataFileRead("lightspark.frag"); - if(fs==NULL) - { - LOG(LOG_ERROR,_("Shader lightspark.frag not found")); - throw RunTimeException("Fragment shader code not found"); - } + // directly include shader source to avoid filesystem access + const char *fs = +#include "lightspark.frag" +; engineData->exec_glShaderSource(f, 1, &fs,NULL); - free((void*)fs); uint32_t g = engineData->exec_glCreateShader_GL_VERTEX_SHADER(); bool ret=true; @@ -300,14 +296,11 @@ throw RunTimeException("Could not compile fragment shader"); } - fs = dataFileRead("lightspark.vert"); - if(fs==NULL) - { - LOG(LOG_ERROR,_("Shader lightspark.vert not found")); - throw RunTimeException("Vertex shader code not found"); - } - engineData->exec_glShaderSource(g, 1, &fs,NULL); - free((void*)fs); + // directly include shader source to avoid filesystem access + const char *fs2 = +#include "lightspark.vert" +; + engineData->exec_glShaderSource(g, 1, &fs2,NULL); engineData->exec_glGetShaderInfoLog(g,1024,&a,str); LOG(LOG_INFO,_("Vertex shader compilation ") << str);
View file
lightspark.tar.xz/src/backends/streamcache.cpp
Changed
@@ -66,7 +66,6 @@ handleAppend(buffer, length); - if (notifyLoader) { Locker locker(stateMutex); receivedLength += length; @@ -175,6 +174,11 @@ return new MemoryStreamCache::Reader(_MR(this)); } +void MemoryStreamCache::openForWriting() +{ + LOG(LOG_ERROR,"openForWriting not implemented in MemoryStreamCache"); +} + MemoryStreamCache::Reader::Reader(_R<MemoryStreamCache> b) : buffer(b), chunkIndex(0), chunkStartOffset(0) {
View file
lightspark.tar.xz/src/backends/streamcache.h
Changed
@@ -43,7 +43,7 @@ */ class DLL_PUBLIC StreamCache : public RefCountable { protected: - StreamCache() DLL_LOCAL; + StreamCache(); // stateMutex must be held while receivedLength, failed or // terminated are accessed @@ -60,7 +60,7 @@ // Wait until more than currentOffset bytes has been received // or until terminated - void waitForData(size_t currentOffset) DLL_LOCAL; + void waitForData(size_t currentOffset); // Derived class implements this to store received data virtual void handleAppend(const unsigned char* buffer, size_t length)=0; @@ -96,6 +96,8 @@ // thread). Every call returns a new, independent streambuf. // The caller must delete the returned value. virtual std::streambuf *createReader()=0; + + virtual void openForWriting() = 0; }; class MemoryChunk; @@ -151,6 +153,8 @@ virtual void reserve(size_t expectedLength); virtual std::streambuf *createReader(); + + void openForWriting(); }; /*
View file
lightspark.tar.xz/src/lightspark.frag
Changed
@@ -1,3 +1,4 @@ +R"( #ifdef GL_ES precision highp float; #endif @@ -30,3 +31,4 @@ gl_FragColor=(vbase*(1.0-yuv))+(val*yuv); } } +)"
View file
lightspark.tar.xz/src/lightspark.vert
Changed
@@ -1,3 +1,4 @@ +R"( attribute vec4 ls_Color; attribute vec2 ls_Vertex; attribute vec2 ls_TexCoord; @@ -18,3 +19,4 @@ ls_TexCoords[0]=vec4(ls_TexCoord, 0, 1); ls_TexCoords[1]=t; } +)"
View file
lightspark.tar.xz/src/platforms/engineutils.cpp
Changed
@@ -39,6 +39,7 @@ uint32_t EngineData::userevent = (uint32_t)-1; Thread* EngineData::mainLoopThread = NULL; bool EngineData::mainthread_running = false; +bool EngineData::sdl_needinit = true; Semaphore EngineData::mainthread_initialized(0); EngineData::EngineData() : currentPixelBuffer(0),currentPixelBufferOffset(0),currentPixelBufPtr(NULL),pixelBufferWidth(0),pixelBufferHeight(0),widget(0), width(0), height(0),needrenderthread(true),windowID(0),visual(0) { @@ -108,12 +109,16 @@ /* main loop handling */ static void mainloop_runner() { - bool sdl_available = false; - if (SDL_WasInit(0)) // some part of SDL already was initialized - sdl_available = SDL_InitSubSystem ( SDL_INIT_VIDEO ); - else - sdl_available = SDL_Init ( SDL_INIT_VIDEO ); - if (sdl_available) + bool sdl_available = !EngineData::sdl_needinit; + + if (EngineData::sdl_needinit) + { + if (SDL_WasInit(0)) // some part of SDL already was initialized + sdl_available = !SDL_InitSubSystem ( SDL_INIT_VIDEO ); + else + sdl_available = !SDL_Init ( SDL_INIT_VIDEO ); + } + if (!sdl_available) { LOG(LOG_ERROR,"Unable to initialize SDL:"<<SDL_GetError()); EngineData::mainthread_initialized.signal(); @@ -221,6 +226,11 @@ LOG(LOG_ERROR, "copying text to clipboard failed:"<<SDL_GetError()); } +StreamCache *EngineData::createFileStreamCache() +{ + return new FileStreamCache(); +} + bool EngineData::getGLError(uint32_t &errorCode) const { errorCode=glGetError();
View file
lightspark.tar.xz/src/platforms/engineutils.h
Changed
@@ -37,6 +37,8 @@ #define LS_USEREVENT_EXEC EngineData::userevent+1 #define LS_USEREVENT_QUIT EngineData::userevent+2 class SystemState; +class StreamCache; + class DLL_PUBLIC EngineData { friend class RenderThread; @@ -69,7 +71,7 @@ /* you may not call getWindowForGnash and showWindow on the same EngineData! */ virtual uint32_t getWindowForGnash()=0; /* Runs 'func' in the mainLoopThread */ - static void runInMainThread(void (*func) (SystemState*) ) + virtual void runInMainThread(SystemState* sys, void (*func) (SystemState*) ) { SDL_Event event; SDL_zero(event); @@ -88,6 +90,7 @@ virtual void grabFocus()=0; virtual void openPageInBrowser(const tiny_string& url, const tiny_string& window)=0; + static bool sdl_needinit; static bool mainthread_running; static Semaphore mainthread_initialized; static bool startSDLMain(); @@ -102,6 +105,7 @@ virtual void setClipboardText(const std::string txt); virtual bool getScreenData(SDL_DisplayMode* screen) = 0; virtual double getScreenDPI() = 0; + virtual StreamCache* createFileStreamCache(); virtual void SwapBuffers() = 0; virtual void InitOpenGL() = 0;
View file
lightspark.tar.xz/src/plugin_ppapi/plugin.cpp
Changed
@@ -19,9 +19,8 @@ // TODO -// - download // - sound -// - run within sandbox +// - font loading // - register as separate plugin #include "version.h" @@ -34,7 +33,6 @@ #include <algorithm> #include <SDL2/SDL.h> #include "threading.h" -#include "scripting/toplevel/JSON.h" #include "plugin_ppapi/plugin.h" #include "plugin_ppapi/ppextscriptobject.h" @@ -63,6 +61,10 @@ #include "ppapi/c/ppb_graphics_3d.h" #include "ppapi/c/ppb_input_event.h" #include "ppapi/c/private/ppb_flash_clipboard.h" +#include "ppapi/c/ppb_file_io.h" +#include "ppapi/c/ppb_file_ref.h" +#include "ppapi/c/ppb_file_system.h" + #include "GLES2/gl2.h" //The interpretation of texture data change with the endianness @@ -93,7 +95,158 @@ static const PPB_KeyboardInputEvent* g_keyboardinputevent_interface = NULL; static const PPB_WheelInputEvent* g_wheelinputevent_interface = NULL; static const PPB_Flash_Clipboard* g_flashclipboard_interface = NULL; +static const PPB_FileIO* g_fileio_interface = NULL; +static const PPB_FileRef* g_fileref_interface = NULL; +static const PPB_FileSystem* g_filesystem_interface = NULL; + + + +ppFileStreamCache::ppFileStreamCache(ppPluginInstance* instance):cache(0),cacheref(0),writeoffset(0),m_instance(instance) +{ +} + +ppFileStreamCache::~ppFileStreamCache() +{ + if (cache != 0) + { + g_fileio_interface->Close(cache); + g_fileref_interface->Delete(cacheref,PP_MakeCompletionCallback(NULL,NULL)); + } +} + +void ppFileStreamCache::handleAppend(const unsigned char* buffer, size_t length) +{ + if (cache == 0) + openCache(); + + int written = g_fileio_interface->Write(cache,writeoffset,(const char*)buffer,length,PP_MakeCompletionCallback(NULL,NULL)); + if (written < 0) + { + LOG(LOG_ERROR,"writing cache file failed, error code:"<<written); + return; + } + writeoffset += written; +} + +/** + * \brief Creates & opens a temporary cache file + * + * Creates a temporary cache file in /tmp and calls \c openExistingCache() with that file. + * Waits for mutex at start and releases mutex when finished. + * \throw RunTimeException Temporary file could not be created + * \throw RunTimeException Called when the cache is already open + * \see Downloader::openExistingCache() + */ +void ppFileStreamCache::openCache() +{ + if (cache != 0) + { + markFinished(true); + throw RunTimeException("ppFileStreamCache::openCache called twice"); + } + + //Create a temporary file(name) + + cacheref = m_instance->createCacheFileRef(); + cache = g_fileio_interface->Create(m_instance->getFileSystem()); + int res = g_fileio_interface->Open(cache,cacheref,PP_FileOpenFlags::PP_FILEOPENFLAG_READ|PP_FileOpenFlags::PP_FILEOPENFLAG_WRITE,PP_MakeCompletionCallback(NULL,NULL)); + if (res != PP_OK) + { + LOG(LOG_ERROR,"opening cache file failed, error code:"<<res); + cache = 0; + } + +} + +void ppFileStreamCache::openForWriting() +{ + if (cache != 0) + return; + openCache(); +} + +bool ppFileStreamCache::waitForCache() +{ + if (cache != 0) + return true; + + // Cache file will be opened when the first byte is received + waitForData(0); + return cache != 0; +} + +std::streambuf *ppFileStreamCache::createReader() +{ + if (!waitForCache()) + { + LOG(LOG_ERROR,"could not open cache file"); + return NULL; + } + + incRef(); + ppFileStreamCache::ppFileStreamCacheReader *fbuf = new ppFileStreamCache::ppFileStreamCacheReader(_MR(this)); + return fbuf; +} + +ppFileStreamCache::ppFileStreamCacheReader::ppFileStreamCacheReader(_R<ppFileStreamCache> b) : curpos(-1),buffer(b) +{ +} + +int ppFileStreamCache::ppFileStreamCacheReader::underflow() +{ + if (!buffer->hasTerminated()) + buffer->waitForData(seekoff(0, ios_base::cur, ios_base::in)); + + return streambuf::underflow(); +} + +streamsize ppFileStreamCache::ppFileStreamCacheReader::xsgetn(char* s, streamsize n) +{ + streamsize read= g_fileio_interface->Read(buffer->cache,curpos,s,n,PP_MakeCompletionCallback(NULL,NULL)); + curpos += read; + // If not enough data was available, wait for writer + while (read < n) + { + buffer->waitForData(seekoff(0, ios_base::cur, ios_base::in)); + + streamsize b = g_fileio_interface->Read(buffer->cache,curpos,s+read,n-read,PP_MakeCompletionCallback(NULL,NULL)); + curpos += b; + + // No more data after waiting, this must be EOF + if (b == 0) + return read; + + read += b; + } + + return read; +} + +streampos ppFileStreamCache::ppFileStreamCacheReader::seekoff(streamoff off, ios_base::seekdir way, ios_base::openmode which) +{ + switch (way) + { + case ios_base::beg: + curpos = off; + break; + case ios_base::cur: + curpos += off; + break; + case ios_base::end: + curpos = buffer->getReceivedLength() + off; + break; + default: + break; + } + return curpos; +} + +streampos ppFileStreamCache::ppFileStreamCacheReader::seekpos(streampos sp, ios_base::openmode which) +{ + curpos = sp; + return curpos; +} ppVariantObject::ppVariantObject(std::map<int64_t, std::unique_ptr<ExtObject> > &objectsMap, PP_Var& other) @@ -306,7 +459,7 @@ return result; } -ppDownloadManager::ppDownloadManager(PP_Instance _instance, SystemState *sys):instance(_instance),m_sys(sys) +ppDownloadManager::ppDownloadManager(ppPluginInstance *_instance, SystemState *sys):m_instance(_instance),m_sys(sys) { type = NPAPI; } @@ -328,7 +481,7 @@ LOG(LOG_INFO, _("NET: PLUGIN: DownloadManager::download '") << url.getParsedURL() <<
View file
lightspark.tar.xz/src/plugin_ppapi/plugin.h
Changed
@@ -4,20 +4,59 @@ #include "swf.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/c/pp_var.h" +#include "ppapi/c/pp_resource.h" namespace lightspark { - class ppDownloader; class ppPluginInstance; + +class ppFileStreamCache : public StreamCache { +private: + class ppFileStreamCacheReader : public std::streambuf { + private: + std::streampos curpos; + _R<ppFileStreamCache> buffer; + virtual int underflow(); + virtual std::streamsize xsgetn(char* s, std::streamsize n); + + std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way,std::ios_base::openmode which); + std::streampos seekpos (std::streampos sp, std::ios_base::openmode which); + public: + ppFileStreamCacheReader(_R<ppFileStreamCache> buffer); + }; + + //Cache filename + PP_Resource cache; + PP_Resource cacheref; + int64_t writeoffset; + ppPluginInstance* m_instance; + + void openCache(); + void openExistingCache(const tiny_string& filename, bool forWriting=true); + + // Block until the cache file is opened by the writer stream + bool waitForCache(); + + virtual void handleAppend(const unsigned char* buffer, size_t length); + +public: + ppFileStreamCache(ppPluginInstance* instance); + virtual ~ppFileStreamCache(); + + virtual std::streambuf *createReader(); + + void openForWriting(); +}; + class ppDownloadManager: public StandaloneDownloadManager { private: - PP_Instance instance; + ppPluginInstance* m_instance; SystemState* m_sys; public: - ppDownloadManager(PP_Instance _instance,SystemState* sys); + ppDownloadManager(ppPluginInstance* _instance,SystemState* sys); Downloader* download(const URLInfo& url, _R<StreamCache> cache, ILoadable* owner); @@ -39,14 +78,16 @@ static void dlStartCallback(void* userdata,int result); static void dlReadResponseCallback(void* userdata,int result); + static void dlStartDownloadCallback(void* userdata,int result); + void startDownload(); public: enum STATE { INIT=0, STREAM_DESTROYED, ASYNC_DESTROY }; STATE state; //Constructor used for the main file - ppDownloader(const tiny_string& _url, PP_Instance _instance, ILoadable* owner, ppPluginInstance* ppinstance); - ppDownloader(const tiny_string& _url, _R<StreamCache> cache, PP_Instance _instance, ILoadable* owner); + ppDownloader(const tiny_string& _url, ILoadable* owner, ppPluginInstance* ppinstance); + ppDownloader(const tiny_string& _url, _R<StreamCache> cache, ppPluginInstance* ppinstance, ILoadable* owner); ppDownloader(const tiny_string& _url, _R<StreamCache> cache, const std::vector<uint8_t>& _data, - const std::list<tiny_string>& headers, PP_Instance _instance, ILoadable* owner); + const std::list<tiny_string>& headers, ppPluginInstance* ppinstance, ILoadable* owner); }; class ppVariantObject : public ExtVariant @@ -72,11 +113,14 @@ PP_Instance m_ppinstance; struct PP_Size m_last_size; PP_Resource m_graphics; + PP_Resource m_cachefilesystem; + ATOMIC_INT32(m_cachefilename); SystemState* m_sys; std::streambuf *mainDownloaderStreambuf; std::istream mainDownloaderStream; ppDownloader* mainDownloader; ParseThread* m_pt; + public: ppPluginInstance(PP_Instance instance, int16_t argc,const char* argn[],const char* argv[]); virtual ~ppPluginInstance(); @@ -87,6 +131,8 @@ SystemState* getSystemState() const { return m_sys;} void startMainParser(); PP_Instance getppInstance() { return m_ppinstance; } + PP_Resource getFileSystem() { return m_cachefilesystem; } + PP_Resource createCacheFileRef(); }; class ppPluginEngineData: public EngineData @@ -95,8 +141,8 @@ ppPluginInstance* instance; public: SystemState* sys; - ACQUIRE_RELEASE_FLAG(inRendering); - ppPluginEngineData(ppPluginInstance* i, uint32_t w, uint32_t h,SystemState* _sys) : EngineData(), instance(i),sys(_sys),inRendering(false) + Semaphore swapbuffer_rendering; + ppPluginEngineData(ppPluginInstance* i, uint32_t w, uint32_t h,SystemState* _sys) : EngineData(), instance(i),sys(_sys),swapbuffer_rendering(0) { width = w; height = h; @@ -106,6 +152,7 @@ void stopMainDownload(); bool isSizable() const { return false; } uint32_t getWindowForGnash(); + void runInMainThread(SystemState* sys, void (*func) (SystemState*) ); /* must be called within mainLoopThread */ SDL_Window* createWidget(uint32_t w,uint32_t h); /* must be called within mainLoopThread */ @@ -114,6 +161,8 @@ void setClipboardText(const std::string txt); bool getScreenData(SDL_DisplayMode* screen); double getScreenDPI(); + StreamCache* createFileStreamCache(); + void SwapBuffers(); void InitOpenGL(); void DeinitOpenGL();
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -1330,7 +1330,7 @@ // Parameter Null means data is generated by calls to "appendBytes" if (args[0]->is<Null>()) { - th->datagenerationfile = new FileStreamCache; + th->datagenerationfile = th->getSystemState()->getEngineData()->createFileStreamCache(); th->datagenerationfile->openForWriting(); th->streamTime=0; return NULL; @@ -1393,7 +1393,7 @@ } else //The URL is valid so we can start the download and add ourself as a job { - StreamCache *cache = new FileStreamCache; + StreamCache *cache = th->getSystemState()->getEngineData()->createFileStreamCache(); th->downloader=getSys()->downloadManager->download(th->url, _MR(cache), NULL); th->streamTime=0; //To be decreffed in jobFence @@ -1658,7 +1658,7 @@ LOG(LOG_INFO,"resetBegin"); if (th->datagenerationfile) delete th->datagenerationfile; - th->datagenerationfile = new FileStreamCache; + th->datagenerationfile = th->getSystemState()->getEngineData()->createFileStreamCache(); th->datagenerationfile->openForWriting(); th->datagenerationbuffer->setLength(0); th->datagenerationthreadstarted = false;
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.h
Changed
@@ -264,7 +264,7 @@ AudioDecoder* audioDecoder; AudioStream *audioStream; // only used when in DataGenerationMode - FileStreamCache* datagenerationfile; + StreamCache* datagenerationfile; bool datagenerationthreadstarted; Mutex mutex; Mutex countermutex;
View file
lightspark.tar.xz/src/swf.cpp
Changed
@@ -268,11 +268,14 @@ inputThread=new InputThread(this); EngineData::userevent = SDL_RegisterEvents(3); - SDL_Event event; - SDL_zero(event); - event.type = LS_USEREVENT_INIT; - event.user.data1 = this; - SDL_PushEvent(&event); + if (EngineData::sdl_needinit) + { + SDL_Event event; + SDL_zero(event); + event.type = LS_USEREVENT_INIT; + event.user.data1 = this; + SDL_PushEvent(&event); + } } void SystemState::setDownloadedPath(const tiny_string& p) @@ -782,7 +785,7 @@ } //The engines must be created in the context of the main thread - engineData->runInMainThread(&SystemState::delayedCreation); + engineData->runInMainThread(this,&SystemState::delayedCreation); //Wait for delayedCreation to finish so it is protected by our 'mutex' //Otherwise SystemState::destroy may delete this object before delayedCreation is scheduled. @@ -1395,18 +1398,18 @@ return; } //Check if this clip is the main clip then honour its FileAttributesTag - if(root == getSys()->mainClip) + if(root == root->getSystemState()->mainClip) { - getSys()->needsAVM2(fat->ActionScript3); + root->getSystemState()->needsAVM2(fat->ActionScript3); if(!fat->ActionScript3) { - delete fat; + delete fat; return; /* no more parsing necessary, handled by fallback */ - } + } if(fat->UseNetwork - && getSys()->securityManager->getSandboxType() == SecurityManager::LOCAL_WITH_FILE) + && root->getSystemState()->securityManager->getSandboxType() == SecurityManager::LOCAL_WITH_FILE) { - getSys()->securityManager->setSandboxType(SecurityManager::LOCAL_WITH_NETWORK); + root->getSystemState()->securityManager->setSandboxType(SecurityManager::LOCAL_WITH_NETWORK); LOG(LOG_INFO, _("Switched to local-with-networking sandbox by FileAttributesTag")); } } @@ -1512,7 +1515,7 @@ delete tag; break; } - if(getSys()->shouldTerminate() || threadAborting) + if(root->getSystemState()->shouldTerminate() || threadAborting) break; } } @@ -1961,9 +1964,9 @@ void SystemState::showMouseCursor(bool visible) { if (visible) - EngineData::runInMainThread(&EngineData::showMouseCursor); + engineData->runInMainThread(this,&EngineData::showMouseCursor); else - EngineData::runInMainThread(&EngineData::hideMouseCursor); + engineData->runInMainThread(this,&EngineData::hideMouseCursor); } void SystemState::waitRendering()
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.