Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 96
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160131.2023 +Version: 0.7.2.99+git20160214.1643 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/backends/audio.cpp
Changed
@@ -58,11 +58,16 @@ return oAudioPlugin != NULL; } -AudioStream *AudioManager::createStreamPlugin ( AudioDecoder *decoder ) +AudioStream *AudioManager::createStreamPlugin (AudioDecoder *decoder , bool startpaused) { if ( pluginLoaded() ) { - return oAudioPlugin->createStream ( decoder ); + AudioStream * res = oAudioPlugin->createStream ( decoder ); + if (startpaused) + res->pause(); + else + res->hasStarted=true; + return res; } else {
View file
lightspark.tar.xz/src/backends/audio.h
Changed
@@ -49,7 +49,7 @@ public: AudioManager ( PluginManager *sharePluginManager ); bool pluginLoaded() const; - AudioStream *createStreamPlugin ( AudioDecoder *decoder ); + AudioStream *createStreamPlugin ( AudioDecoder *decoder, bool startpaused ); bool isTimingAvailablePlugin() const; void set_audiobackend ( std::string desired_backend ); void get_audioBackendsList();
View file
lightspark.tar.xz/src/backends/builtindecoder.cpp
Changed
@@ -32,6 +32,7 @@ { FLV_HEADER h(stream); valid=h.isValid(); + hasvideo=h.hasVideo(); } else valid=false; @@ -67,6 +68,8 @@ { AudioDataTag tag(stream); prevSize=tag.getTotalLen(); + if (tag.packetLen == 0) + return false; if(audioDecoder==NULL) {
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -950,7 +950,10 @@ if (customVideoDecoder) { if (customVideoDecoder->decodePacket(&pkt, mtime)) + { customVideoDecoder->framesdecoded++; + hasvideo=true; + } } } av_free_packet(&pkt);
View file
lightspark.tar.xz/src/backends/decoder.h
Changed
@@ -329,14 +329,16 @@ class StreamDecoder { public: - StreamDecoder():audioDecoder(NULL),videoDecoder(NULL),valid(false){} + StreamDecoder():audioDecoder(NULL),videoDecoder(NULL),valid(false),hasvideo(false){} virtual ~StreamDecoder(); virtual bool decodeNextFrame() = 0; bool isValid() const { return valid; } AudioDecoder* audioDecoder; VideoDecoder* videoDecoder; + bool hasVideo() const { return hasvideo; } protected: bool valid; + bool hasvideo; }; #ifdef ENABLE_LIBAVCODEC
View file
lightspark.tar.xz/src/backends/interfaces/audio/IAudioPlugin.cpp
Changed
@@ -69,7 +69,7 @@ AudioStream::AudioStream ( lightspark::AudioDecoder* dec ): - decoder(dec) + decoder(dec),hasStarted(false) { }
View file
lightspark.tar.xz/src/backends/interfaces/audio/IAudioPlugin.h
Changed
@@ -28,10 +28,10 @@ class AudioStream { - protected: +protected: AudioStream(lightspark::AudioDecoder *dec = NULL); - public: +public: lightspark::AudioDecoder *decoder; virtual bool ispaused() = 0; //Is the stream paused? (corked) virtual bool isValid() = 0; //Is the stream alive, fully working? @@ -41,6 +41,7 @@ virtual ~AudioStream() {}; virtual void setVolume(double volume) {LOG(LOG_NOT_IMPLEMENTED,"setVolume not implemented in plugin");} + bool hasStarted; }; /**********************
View file
lightspark.tar.xz/src/scripting/flash/media/flashmedia.cpp
Changed
@@ -497,7 +497,7 @@ //TODO: Move the audio plugin check before if(audioStream==NULL && audioDecoder && audioDecoder->isValid() && getSys()->audioManager->pluginLoaded()) - audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder); + audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder,false); // TODO: check the position only when the getter is called if(audioStream) @@ -568,7 +568,7 @@ { decoder->decodeStreamSomePackets(stream, 0,this); if (decoder->isValid() && (audioStream == NULL)) - audioStream=getSys()->audioManager->createStreamPlugin(decoder); + audioStream=getSys()->audioManager->createStreamPlugin(decoder,false); if(threadAborting) break; }
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -610,7 +610,7 @@ c->setVariableByQName("PENDING","",Class<ASString>::getInstanceS("pending"),DECLARED_TRAIT); } -std::map<tiny_string, SharedObject* > SharedObject::sharedobjectmap; +std::map<tiny_string, ASObject* > SharedObject::sharedobjectmap; SharedObject::SharedObject(Class_base* c):EventDispatcher(c),client(this),objectEncoding(ObjectEncoding::AMF3) { data=_MR(new_asobject()); @@ -671,18 +671,22 @@ if (name=="") throwError<ASError>(0,"invalid name"); - if (localPath != "" || secure) - LOG(LOG_NOT_IMPLEMENTED,"SharedObject.getLocal: parameters 'localPath' and 'secure' are ignored"); + if (secure) + LOG(LOG_NOT_IMPLEMENTED,"SharedObject.getLocal: parameter 'secure' is ignored"); - std::map<tiny_string, SharedObject* >::iterator it = sharedobjectmap.find(name); + tiny_string fullname = localPath + "|"; + fullname += name; + SharedObject* res = Class<SharedObject>::getInstanceS(); + std::map<tiny_string, ASObject* >::iterator it = sharedobjectmap.find(fullname); if (it == sharedobjectmap.end()) { - sharedobjectmap.insert(make_pair(name,Class<SharedObject>::getInstanceS())); - it = sharedobjectmap.find(name); + sharedobjectmap.insert(make_pair(fullname,Class<ASObject>::getInstanceS())); + it = sharedobjectmap.find(fullname); } it->second->incRef(); - return it->second; + res->data = _NR<ASObject>(it->second); + return res; } ASFUNCTIONBODY(SharedObject,getRemote) @@ -1685,6 +1689,11 @@ } if(paused) return; + if(audioStream && audioStream->isValid() && !audioStream->hasStarted) + { + audioStream->hasStarted = true; + audioStream->resume(); + } //Advance video and audio to current time, follow the audio stream time countermutex.lock(); if(audioStream && getSys()->audioManager->isTimingAvailablePlugin()) @@ -1849,9 +1858,6 @@ if (frameRate) { this->playbackBytesPerSecond = s.tellg() / (framesdecoded / frameRate); - // TODO this overrides the real number of decoded frames - // otherwise on slow computers we never get the buffer filled - //framesdecoded = (this->getReceivedLength() / this->playbackBytesPerSecond) * frameRate; this->bufferLength = (framesdecoded / frameRate) - (streamTime-prevstreamtime)/1000.0; } countermutex.unlock(); @@ -1877,9 +1883,8 @@ audioDecoder=streamDecoder->audioDecoder; if(audioStream==NULL && audioDecoder && audioDecoder->isValid() && getSys()->audioManager->pluginLoaded()) - audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder); - - if(!tickStarted && isReady() && ((framesdecoded / frameRate) >= this->bufferTime)) + audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder,streamDecoder->hasVideo()); + if(!tickStarted && isReady() && frameRate && ((framesdecoded / frameRate) >= this->bufferTime)) { tickStarted=true; this->incRef(); @@ -1890,7 +1895,7 @@ float localRenderRate=dmin(frameRate,24); getSys()->setRenderRate(localRenderRate); } - if (!bufferfull && ((framesdecoded / frameRate) >= this->bufferTime)) + if (!bufferfull && frameRate && ((framesdecoded / frameRate) >= this->bufferTime)) { bufferfull = true; this->incRef();
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.h
Changed
@@ -107,7 +107,7 @@ class SharedObject: public EventDispatcher { private: - static std::map<tiny_string, SharedObject* > sharedobjectmap; + static std::map<tiny_string, ASObject* > sharedobjectmap; public: SharedObject(Class_base* c); static void sinit(Class_base*);
View file
lightspark.tar.xz/src/scripting/flash/ui/Mouse.cpp
Changed
@@ -60,7 +60,7 @@ tiny_string cursorName; ARG_UNPACK(cursorName); if (cursorName != "auto") - throwError<ArgumentError>(kInvalidEnumError, "cursor"); + LOG(LOG_NOT_IMPLEMENTED,"setting mouse cursor is not implemented"); return NULL; }
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
.