Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 83
View file
lightspark.spec
Changed
@@ -24,7 +24,7 @@ %endif Name: lightspark -Version: 0.7.2.99+git20150906.1640 +Version: 0.7.2.99+git20150927.1629 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
build.patch
Changed
@@ -1,17 +1,39 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81b6d9d..b31eacd 100644 +index 81b6d9d..0b9790d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,6 +247,9 @@ ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.4) IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) ADD_DEFINITIONS(-DLLVM_36) ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) -+IF(${LLVM_STRING_VERSION} VERSION_GREATER 3.6) ++IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) + ADD_DEFINITIONS(-DLLVM_37) -+ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.6) ++ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) INCLUDE(FindZLIB REQUIRED) INCLUDE(FindFreetype REQUIRED) IF(NOT(ENABLE_GLES2)) +@@ -312,6 +315,8 @@ IF(ENABLE_LIBAVCODEC) + CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) + CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) + CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) ++ CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) ++ CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) + CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) + + SET(CMAKE_REQUIRED_FLAGS) +@@ -347,6 +352,12 @@ IF(ENABLE_LIBAVCODEC) + IF(LIBAVRESAMPLE_FOUND) + ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) + ENDIF(LIBAVRESAMPLE_FOUND) ++ IF(HAVE_AV_FRAME_ALLOC) ++ ADD_DEFINITIONS(-DHAVE_AV_FRAME_ALLOC) ++ ENDIF(HAVE_AV_FRAME_ALLOC) ++ IF(HAVE_AV_FRAME_UNREF) ++ ADD_DEFINITIONS(-DHAVE_AV_FRAME_UNREF) ++ ENDIF(HAVE_AV_FRAME_UNREF) + ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) + ENDIF(ENABLE_LIBAVCODEC) + diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake index e60dd4a..0f4f950 100644 --- a/conf/FindLLVM.cmake @@ -48,10 +70,25 @@ exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS}) diff --git a/src/backends/decoder.cpp b/src/backends/decoder.cpp -index fbdfcdb..e1d6e95 100755 +index fbdfcdb..98151c4 100755 --- a/src/backends/decoder.cpp +++ b/src/backends/decoder.cpp -@@ -166,7 +166,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(LS_VIDEO_CODEC codecId, uint8_t* initdata +@@ -30,6 +30,14 @@ + #define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO + #endif + ++#ifndef HAVE_AV_FRAME_ALLOC ++#define av_frame_alloc avcodec_alloc_frame ++#endif ++ ++#ifndef HAVE_AV_FRAME_UNREF ++#define av_frame_unref avcodec_get_frame_defaults ++#endif ++ + using namespace lightspark; + using namespace std; + +@@ -166,7 +174,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(LS_VIDEO_CODEC codecId, uint8_t* initdata else status=INIT; @@ -60,7 +97,7 @@ } FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): -@@ -201,7 +201,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint) +@@ -201,7 +209,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint) if(fillDataAndCheckValidity()) status=VALID; @@ -69,7 +106,7 @@ } FFMpegVideoDecoder::~FFMpegVideoDecoder() -@@ -476,7 +476,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initd +@@ -476,7 +484,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initd else status=INIT; #if HAVE_AVCODEC_DECODE_AUDIO4 @@ -78,7 +115,7 @@ #endif } -@@ -502,7 +502,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC lscodec, int sampleRate, i +@@ -502,7 +510,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC lscodec, int sampleRate, i if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 @@ -87,7 +124,7 @@ #endif } -@@ -522,7 +522,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),c +@@ -522,7 +530,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),c if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 @@ -96,7 +133,7 @@ #endif } -@@ -607,7 +607,7 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t +@@ -607,7 +615,7 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t } #if HAVE_AVCODEC_DECODE_AUDIO4 @@ -105,7 +142,7 @@ int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); if(frameOk==0) -@@ -664,7 +664,7 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) +@@ -664,7 +672,7 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; #if HAVE_AVCODEC_DECODE_AUDIO4 @@ -1424,7 +1461,7 @@ uint low; uint high; diff --git a/src/scripting/flash/events/flashevents.cpp b/src/scripting/flash/events/flashevents.cpp -index 20623c6..e6864b1 100644 +index 3e514f0..164810d 100644 --- a/src/scripting/flash/events/flashevents.cpp +++ b/src/scripting/flash/events/flashevents.cpp @@ -189,13 +189,13 @@ ASFUNCTIONBODY(Event,clone) @@ -1443,7 +1480,7 @@ LOG(LOG_NOT_IMPLEMENTED,"Event.stopImmediatePropagation not implemented"); return NULL; } -@@ -1417,8 +1417,8 @@ void UncaughtErrorEvents::sinit(Class_base* c) +@@ -1420,8 +1420,8 @@ void UncaughtErrorEvents::sinit(Class_base* c) ASFUNCTIONBODY(UncaughtErrorEvents, _constructor) {
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -201,6 +201,7 @@ c->prototype->setVariableByQName("hasOwnProperty","",Class<IFunction>::getFunction(hasOwnProperty),DYNAMIC_TRAIT); c->prototype->setVariableByQName("isPrototypeOf","",Class<IFunction>::getFunction(isPrototypeOf),DYNAMIC_TRAIT); c->prototype->setVariableByQName("propertyIsEnumerable","",Class<IFunction>::getFunction(propertyIsEnumerable),DYNAMIC_TRAIT); + c->prototype->setVariableByQName("setPropertyIsEnumerable","",Class<IFunction>::getFunction(setPropertyIsEnumerable),DYNAMIC_TRAIT); } @@ -1814,7 +1815,6 @@ params[1] = varIt->second.var; params[1]->incRef(); ASObject *funcret=replacer->call(getSys()->getNullRef(), params, 2); - LOG(LOG_ERROR,"funcall:"<<res<<"|"<<funcret); if (funcret) res += funcret->toString(); else
View file
lightspark.tar.xz/src/backends/extscriptobject.cpp
Changed
@@ -266,13 +266,14 @@ case EV_OBJECT: { ExtObject* objValue = getObject(); + /* auto it=objectsMap.find(objValue); if(it!=objectsMap.end()) { it->second->incRef(); return it->second; } - + */ uint32_t count; // We are converting an array, so lets set indexes
View file
lightspark.tar.xz/src/backends/netutils.cpp
Changed
@@ -287,9 +287,7 @@ */ void Downloader::setFailed() { - cache->markFinished(true); - //Set the final length - length = cache->getReceivedLength(); + length = cache->markFinished(true); } /** @@ -303,9 +301,7 @@ */ void Downloader::setFinished() { - cache->markFinished(); - //Set the final length - length = cache->getReceivedLength(); + length = cache->markFinished(); } /**
View file
lightspark.tar.xz/src/backends/streamcache.cpp
Changed
@@ -33,15 +33,16 @@ { } -void StreamCache::markFinished(bool _failed) +size_t StreamCache::markFinished(bool _failed) { Locker locker(stateMutex); if (terminated) - return; + return receivedLength; failed = _failed; terminated = true; stateCond.broadcast(); + return receivedLength; } void StreamCache::waitForData(size_t currentOffset)
View file
lightspark.tar.xz/src/backends/streamcache.h
Changed
@@ -86,7 +86,8 @@ // Writer should call this when all of the stream has been // append()'ed - void markFinished(bool failed=false); + // returns the received length + size_t markFinished(bool failed=false); // Create a streambuf for reading from this buffer (reader // thread). Every call returns a new, independent streambuf.
View file
lightspark.tar.xz/src/parsing/crossdomainpolicy.cpp
Changed
@@ -26,7 +26,6 @@ type(_type),subtype(_subtype),master(_master),first(true),siteControlFound(false) { xml.load_buffer(buffer, length); - } CrossDomainPolicy::ELEMENT CrossDomainPolicy::getNextElement() @@ -35,9 +34,10 @@ { if (first) { - if (strcmp(xml.root().name(), "cross-domain-policy")) - return INVALID; currentnode = xml.root().first_child(); + if (strcmp(currentnode.name(), "cross-domain-policy")) + return INVALID; + currentnode = currentnode.first_child(); } else currentnode = currentnode.next_sibling(); @@ -48,8 +48,6 @@ //We only handle elements if (currentnode.type() != pugi::node_element) continue; - if(!currentnode.empty()) - return INVALID; tagName = currentnode.name(); attrCount = 0;
View file
lightspark.tar.xz/src/plugin/npscriptobject.cpp
Changed
@@ -370,10 +370,12 @@ { type = EV_OBJECT; NPObject* const npObj = NPVARIANT_TO_OBJECT(other); + /* auto it=objectsMap.find(npObj); if(it!=objectsMap.end()) objectValue = it->second.get(); else + */ objectValue = new NPObjectObject(objectsMap, _instance, npObj); break; } @@ -1028,7 +1030,7 @@ { // The NPScriptObject should already be deleted _before_ we get to this point. // This is the only way we can guarantee that it is deleted _before_ SystemState is deleted. -}; +} // Properties bool NPScriptObjectGW::getProperty(NPObject* obj, NPIdentifier id, NPVariant* result)
View file
lightspark.tar.xz/src/scripting/abc.h
Changed
@@ -248,7 +248,7 @@ arg1->decRef(); _R<ApplicationDomain> appDomain = getCurrentApplicationDomain(th); T ret=appDomain->readFromDomainMemory<T>(addr); - th->runtime_stack_push(abstract_ui(ret)); + th->runtime_stack_push(abstract_i(ret)); } template<class T> static void storeIntN(call_context* th) @@ -257,7 +257,7 @@ ASObject* arg2=th->runtime_stack_pop(); uint32_t addr=arg1->toUInt(); arg1->decRef(); - uint32_t val=arg2->toUInt(); + int32_t val=arg2->toInt(); arg2->decRef(); _R<ApplicationDomain> appDomain = getCurrentApplicationDomain(th); appDomain->writeToDomainMemory<T>(addr, val);
View file
lightspark.tar.xz/src/scripting/flash/events/flashevents.cpp
Changed
@@ -607,6 +607,9 @@ ASFUNCTIONBODY(EventDispatcher,removeEventListener) { EventDispatcher* th=static_cast<EventDispatcher*>(obj); + + if (args[1]->getObjectType() == T_NULL) // it seems that null is allowed as function + return NULL; if(args[0]->getObjectType()!=T_STRING || args[1]->getObjectType()!=T_FUNCTION) throw RunTimeException("Type mismatch in EventDispatcher::removeEventListener");
View file
lightspark.tar.xz/src/scripting/flash/media/flashmedia.cpp
Changed
@@ -539,6 +539,7 @@ void SoundChannel::playRaw() { assert(!stream.isNull()); +#ifdef ENABLE_LIBAVCODEC FFMpegAudioDecoder *decoder = new FFMpegAudioDecoder(format.codec, format.sampleRate, format.channels, @@ -572,6 +573,7 @@ incRef(); getVm()->addEvent(_MR(this),_MR(Class<Event>::getInstanceS("soundComplete"))); } +#endif //ENABLE_LIBAVCODEC } void SoundChannel::jobFence()
View file
lightspark.tar.xz/src/scripting/flash/xml/flashxml.cpp
Changed
@@ -51,6 +51,8 @@ c->setDeclaredMethodByQName("nodeValue","",Class<IFunction>::getFunction(_getNodeValue),GETTER_METHOD,true); c->setDeclaredMethodByQName("parentNode","",Class<IFunction>::getFunction(parentNode),GETTER_METHOD,true); c->setDeclaredMethodByQName("previousSibling","",Class<IFunction>::getFunction(previousSibling),GETTER_METHOD,true); + c->setDeclaredMethodByQName("localName","",Class<IFunction>::getFunction(_getLocalName),GETTER_METHOD,true); + c->setDeclaredMethodByQName("appendChild","",Class<IFunction>::getFunction(appendChild),NORMAL_METHOD,true); } void XMLNode::buildTraits(ASObject* o) @@ -227,6 +229,29 @@ return Class<ASString>::getInstanceS(th->toString_priv(th->node)); } +ASFUNCTIONBODY(XMLNode,_getLocalName) +{ + XMLNode* th=Class<XMLNode>::cast(obj); + tiny_string localname =th->node.name(); + uint32_t pos = localname.find("."); + if (pos != tiny_string::npos) + { + localname = localname.substr(pos,localname.numChars()-pos); + } + return Class<ASString>::getInstanceS(localname); +} +ASFUNCTIONBODY(XMLNode,appendChild) +{ + XMLNode* th=Class<XMLNode>::cast(obj); + _NR<XMLNode> c; + ARG_UNPACK(c); + th->node.append_move(c->node); + if (!c->root.isNull()) + c->root->decRef(); + c->root = th->root; + th->root->incRef(); + return NULL; +} tiny_string XMLNode::toString() { return toString_priv(node); @@ -258,6 +283,7 @@ c->setDeclaredMethodByQName("parseXML","",Class<IFunction>::getFunction(parseXML),NORMAL_METHOD,true); c->setDeclaredMethodByQName("toString","",Class<IFunction>::getFunction(_toString),NORMAL_METHOD,true); c->setDeclaredMethodByQName("firstChild","",Class<IFunction>::getFunction(XMLDocument::firstChild),GETTER_METHOD,true); + c->setDeclaredMethodByQName("createElement","",Class<IFunction>::getFunction(XMLDocument::createElement),NORMAL_METHOD,true); REGISTER_GETTER_SETTER(c, ignoreWhite); } @@ -326,3 +352,14 @@ th->incRef(); return Class<XMLNode>::getInstanceS(_MR(th),newNode); } +ASFUNCTIONBODY(XMLDocument,createElement) +{ + XMLDocument* th=Class<XMLDocument>::cast(obj); + assert(th->node==NULL); + tiny_string name; + ARG_UNPACK(name); + pugi::xml_node newNode; + newNode.set_name(name.raw_buf()); + th->incRef(); + return Class<XMLNode>::getInstanceS(_MR(th),newNode); +}
View file
lightspark.tar.xz/src/scripting/flash/xml/flashxml.h
Changed
@@ -53,10 +53,12 @@ ASFUNCTION(_getNodeType); ASFUNCTION(_getNodeName); ASFUNCTION(_getNodeValue); + ASFUNCTION(_getLocalName); ASFUNCTION(nextSibling); ASFUNCTION(parentNode); ASFUNCTION(previousSibling); ASFUNCTION(_toString); + ASFUNCTION(appendChild); }; class XMLDocument: public XMLNode, public XMLBase @@ -75,6 +77,7 @@ ASFUNCTION(parseXML); ASFUNCTION(firstChild); ASFUNCTION(_toString); + ASFUNCTION(createElement); //Serialization interface void serialize(ByteArray* out, std::map<tiny_string, uint32_t>& stringMap, std::map<const ASObject*, uint32_t>& objMap,
View file
lightspark.tar.xz/src/scripting/toplevel/Integer.cpp
Changed
@@ -148,8 +148,7 @@ case T_INTEGER: return val==o->toInt(); case T_UINTEGER: - //CHECK: somehow wrong - return val==o->toInt(); + return val >= 0 && val==o->toInt(); case T_NUMBER: return val==o->toNumber(); case T_BOOLEAN:
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -1266,7 +1266,10 @@ { XMLVector ret; tiny_string defns = "|"; - defns += getVm()->getDefaultXMLNamespace(); + if (nodenamespace_prefix == "" && nodenamespace_uri != "") + defns += nodenamespace_uri; + else + defns += getVm()->getDefaultXMLNamespace(); defns += "|"; tiny_string normalizedName= ""; normalizedName= name.normalizedName(); @@ -2513,7 +2516,10 @@ node->nodetype = srcnode.type(); node->nodename = srcnode.name(); node->nodevalue = srcnode.value(); - node->nodenamespace_uri = getVm()->getDefaultXMLNamespace(); + if (!node->parentNode.isNull() && node->parentNode->nodenamespace_prefix == "") + node->nodenamespace_uri = node->parentNode->nodenamespace_uri; + else + node->nodenamespace_uri = getVm()->getDefaultXMLNamespace(); if (ignoreWhitespace && node->nodetype == pugi::node_pcdata) node->nodevalue = node->removeWhitespace(node->nodevalue); node->attributelist = _MR(Class<XMLList>::getInstanceS());
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -569,7 +569,7 @@ Function* f=dynamic_cast<Function*>(r); if(f==NULL) return false; - return (val==f->val) && (closure_this==f->closure_this); + return (val==f->val) && (closure_this.isNull() || f->closure_this.isNull() || closure_this==f->closure_this); } bool Null::isEqual(ASObject* r) @@ -1305,7 +1305,7 @@ void Class_base::describeTraits(pugi::xml_node &root, std::vector<traits_info>& traits) const { - std::map<u30, pugi::xml_node*> accessorNodes; + std::map<u30, pugi::xml_node> accessorNodes; for(unsigned int i=0;i<traits.size();i++) { traits_info& t=traits[i]; @@ -1360,18 +1360,16 @@ if(existing==accessorNodes.end()) { node=root.append_child("accessor"); - accessorNodes[t.name]=&node; + node.append_attribute("name").set_value(getSys()->getStringFromUniqueId(mname->name_s_id).raw_buf()); } else - node=*existing->second; - - node.append_attribute("name").set_value(getSys()->getStringFromUniqueId(mname->name_s_id).raw_buf()); + { + node=existing->second; + } const char* access=NULL; - tiny_string oldAccess; pugi::xml_attribute oldAttr=node.attribute("access"); - if (!oldAttr.empty()) - oldAccess=oldAttr.value(); + tiny_string oldAccess=oldAttr.value(); if(kind==traits_info::Getter && oldAccess=="") access="readonly"; @@ -1381,13 +1379,8 @@ (kind==traits_info::Setter && oldAccess=="readonly")) access="readwrite"; - if(access) - { - if (oldAttr.empty()) - node.append_attribute("access").set_value(access); - else - oldAttr.set_value(access); - } + node.remove_attribute("access"); + node.append_attribute("access").set_value(access); tiny_string type; method_info& method=context->methods[t.method]; @@ -1410,6 +1403,7 @@ node.append_attribute("declaredBy").set_value(getQualifiedClassName().raw_buf()); describeMetadata(node, t); + accessorNodes[t.name]=node; } } }
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
.