Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 95
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160111.1047 +Version: 0.7.2.99+git20160131.2023 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/backends/interfaces/audio/sdl/SDLPlugin.cpp
Changed
@@ -52,16 +52,7 @@ sdl_available = !SDL_InitSubSystem ( SDL_INIT_AUDIO ); else sdl_available = !SDL_Init ( SDL_INIT_AUDIO ); - if (Mix_OpenAudio (LIGHTSPARK_AUDIO_SDL_SAMPLERATE, AUDIO_S16, 2, LIGHTSPARK_AUDIO_SDL_BUFERSIZE) < 0) - { - LOG(LOG_ERROR,"Couldn't open SDL_mixer"); - sdl_available = 0; - SDL_QuitSubSystem ( SDL_INIT_AUDIO ); - if (!SDL_WasInit(0)) - SDL_Quit (); - return; - } - Mix_Pause(-1); + mixeropened = 0; } void SDLPlugin::set_device(std::string desiredDevice, IAudioPlugin::DEVICE_TYPES desiredType) @@ -73,6 +64,16 @@ { if (!sdl_available) return NULL; + if (!mixeropened) + { + if (Mix_OpenAudio (LIGHTSPARK_AUDIO_SDL_SAMPLERATE, AUDIO_S16, 2, LIGHTSPARK_AUDIO_SDL_BUFERSIZE) < 0) + { + LOG(LOG_ERROR,"Couldn't open SDL_mixer"); + sdl_available = 0; + return NULL; + } + mixeropened = 1; + } SDLAudioStream *stream = new SDLAudioStream(this); stream->decoder = decoder; @@ -92,9 +93,12 @@ for (stream_iterator it = streams.begin(); it != streams.end(); ++it) { delete *it; } - if (sdl_available) + if (mixeropened) { Mix_CloseAudio(); + } + if (sdl_available) + { SDL_QuitSubSystem ( SDL_INIT_AUDIO ); if (!SDL_WasInit(0)) SDL_Quit (); @@ -174,7 +178,7 @@ bool SDLAudioStream::ispaused() { - return SDL_GetAudioStatus() != SDL_AUDIO_PLAYING; + return Mix_Paused(mixer_channel); } bool SDLAudioStream::isValid()
View file
lightspark.tar.xz/src/backends/interfaces/audio/sdl/SDLPlugin.h
Changed
@@ -39,7 +39,7 @@ friend class SDLAudioStream; private: int sdl_available; - + int mixeropened; public: SDLPlugin ( std::string init_Name = "SDL plugin", std::string init_audiobackend = "sdl", bool init_stopped = false );
View file
lightspark.tar.xz/src/backends/rendering.cpp
Changed
@@ -683,6 +683,11 @@ cairo_restore(cr); } +void RenderThread::waitRendering() +{ + Locker l(mutexRendering); +} + //Send the texture drawn by Cairo to the GPU void RenderThread::mapCairoTexture(int w, int h) { @@ -757,6 +762,7 @@ void RenderThread::coreRendering() { + Locker l(mutexRendering); glBindFramebuffer(GL_FRAMEBUFFER, 0); glDrawBuffer(GL_BACK); //Clear the back buffer @@ -863,7 +869,7 @@ if(!diff.negative()) /* is one seconds elapsed? */ { time_s=time_d; - LOG(LOG_INFO,_("FPS: ") << dec << frameCount); + LOG(LOG_INFO,_("FPS: ") << dec << frameCount<<" "<<getVm()->getEventQueueSize()); frameCount=0; secsCount++; }
View file
lightspark.tar.xz/src/backends/rendering.h
Changed
@@ -115,6 +115,7 @@ void coreRendering(); void plotProfilingData(); Semaphore initialized; + Mutex mutexRendering; static void SizeAllocateCallback(GtkWidget* widget, GdkRectangle* allocation, gpointer data); public: @@ -175,6 +176,7 @@ cairo_t* getCairoContext(int w, int h); void mapCairoTexture(int w, int h); void renderText(cairo_t *cr, const char *text, int x, int y); + void waitRendering(); }; RenderThread* getRenderThread();
View file
lightspark.tar.xz/src/main.cpp
Changed
@@ -35,8 +35,9 @@ class StandaloneEngineData: public EngineData { guint destroyHandlerId; + guint deleteHandlerId; public: - StandaloneEngineData() : destroyHandlerId(0) + StandaloneEngineData() : destroyHandlerId(0),deleteHandlerId(0) { #ifndef _WIN32 visual = XVisualIDFromVisual(gdk_x11_visual_get_xvisual(gdk_visual_get_system())); @@ -52,6 +53,8 @@ { if(widget) { + if(deleteHandlerId) + g_signal_handler_disconnect(widget, deleteHandlerId); if(destroyHandlerId) g_signal_handler_disconnect(widget, destroyHandlerId); @@ -66,10 +69,17 @@ e->widget = NULL; getSys()->setShutdownFlag(); } + static gboolean StandaloneDelete(GtkWidget *widget, gpointer data) + { + // wait for rendering complete + getSys()->waitRendering(); + return FALSE; + } GtkWidget* createGtkWidget() { GtkWidget* window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title((GtkWindow*)window,"Lightspark"); + deleteHandlerId = g_signal_connect(window,"delete_event",G_CALLBACK(StandaloneDelete),this); destroyHandlerId = g_signal_connect(window,"destroy",G_CALLBACK(StandaloneDestroy),this); return window; }
View file
lightspark.tar.xz/src/parsing/flv.cpp
Changed
@@ -204,7 +204,7 @@ aligned_free(packetData); } -AudioDataTag::AudioDataTag(std::istream& s):VideoTag(s),_isHeader(false) +AudioDataTag::AudioDataTag(std::istream& s):VideoTag(s),_isHeader(false),packetData(NULL),packetLen(0) { unsigned int start=s.tellg(); BitStream bs(s); @@ -236,13 +236,15 @@ _isHeader=(t==0); headerConsumed++; } - packetLen=dataSize-headerConsumed; - - aligned_malloc((void**)&packetData, 16, packetLen+16); //Ensure no overrun happens when doing aligned reads - - s.read((char*)packetData,packetLen); - memset(packetData+packetLen,0,16); - + if (dataSize > headerConsumed) + { + packetLen=dataSize-headerConsumed; + + aligned_malloc((void**)&packetData, 16, packetLen+16); //Ensure no overrun happens when doing aligned reads + + s.read((char*)packetData,packetLen); + memset(packetData+packetLen,0,16); + } //Compute totalLen unsigned int end=s.tellg(); totalLen=(end-start)+11; @@ -250,5 +252,6 @@ AudioDataTag::~AudioDataTag() { - aligned_free(packetData); + if (packetData) + aligned_free(packetData); }
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -2104,10 +2104,6 @@ { case traits_info::Class: { - // check if class is alreadey defined in this context - if (root->applicationDomain->getVariableByMultinameOpportunistic(*mname)) - return; - //Check if this already defined in upper levels _NR<ASObject> tmpo=obj->getVariableByMultiname(*mname,ASObject::SKIP_IMPL); if(!tmpo.isNull())
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -469,7 +469,8 @@ //otherwise create a child of the system domain. If the security domain is different //the passed applicationDomain is ignored _R<RootMovieClip> currentRoot=getVm()->currentCallContext->context->root; - if(currentRoot->getOrigin().getHostname()==th->url.getHostname() || !secDomain.isNull()) + // empty origin is possible if swf is loaded by loadBytes() + if(currentRoot->getOrigin().isEmpty() || currentRoot->getOrigin().getHostname()==th->url.getHostname() || !secDomain.isNull()) { //Same domain _NR<ApplicationDomain> parentDomain = currentRoot->applicationDomain;
View file
lightspark.tar.xz/src/scripting/flash/media/flashmedia.cpp
Changed
@@ -569,6 +569,8 @@ decoder->decodeStreamSomePackets(stream, 0,this); if (decoder->isValid() && (audioStream == NULL)) audioStream=getSys()->audioManager->createStreamPlugin(decoder); + if(threadAborting) + break; } while (!ACQUIRE_READ(stopped) && !stream.eof() && !stream.fail() && !stream.bad());
View file
lightspark.tar.xz/src/swf.cpp
Changed
@@ -1981,6 +1981,11 @@ EngineData::runInGtkThread(sigc::mem_fun(engineData, &EngineData::hideMouseCursor)); } +void SystemState::waitRendering() +{ + getRenderThread()->waitRendering(); +} + /* This is run in vm's thread context */ void RootMovieClip::initFrame() {
View file
lightspark.tar.xz/src/swf.h
Changed
@@ -444,6 +444,7 @@ void openPageInBrowser(const tiny_string& url, const tiny_string& window); void showMouseCursor(bool visible); + void waitRendering() DLL_PUBLIC; }; class ParseThread: public IThreadJob
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
.