Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 90
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without rtmp Name: lightspark -Version: 0.7.2.99+git20151206.1521 +Version: 0.7.2.99+git20151228.1242 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/backends/builtindecoder.cpp
Changed
@@ -55,7 +55,8 @@ { UI32_FLV PreviousTagSize; stream >> PreviousTagSize; - assert_and_throw(PreviousTagSize==prevSize); + // It seems that Adobe simply ignores invalid values for PreviousTagSize + //assert_and_throw(PreviousTagSize==prevSize); //Check tag type and read it UI8 TagType;
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -285,7 +285,7 @@ #else int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, data, datalen); #endif - if (ret < 0 || frameOk == 0) + if (ret < 0) { LOG(LOG_INFO,"not decoded:"<<ret<<" "<< frameOk); return false; @@ -313,7 +313,7 @@ #else int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, pkt->data, pkt->size); #endif - if (ret < 0 || frameOk == 0) + if (ret < 0) { LOG(LOG_INFO,"not decoded:"<<ret<<" "<< frameOk); return false; @@ -642,7 +642,9 @@ int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); if(frameOk==0) - ret=-1; + { + LOG(LOG_ERROR,"not decoded audio:"<<ret); + } else { if (frameIn->format != AV_SAMPLE_FMT_S16) @@ -699,7 +701,9 @@ int frameOk=0; int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); if(frameOk==0) - ret=-1; + { + LOG(LOG_ERROR,"not decoded audio:"<<ret); + } else { if (frameIn->format != AV_SAMPLE_FMT_S16)
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -138,7 +138,7 @@ this->incRef(); getVm()->addEvent(_MR(this),_MR(Class<ProgressEvent>::getInstanceS(bytesLoaded,bytesTotal))); } - if(loadStatus==INIT_SENT || (bytesLoaded == bytesTotal)) + if(loadStatus==INIT_SENT) { //The clip is also complete now if(getVm())
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -353,6 +353,7 @@ bool success=false; if(!downloader->hasFailed()) { + loader->incRef(); getVm()->addEvent(loader,_MR(Class<Event>::getInstanceS("open"))); cache->waitForTermination(); @@ -610,7 +611,7 @@ } std::map<tiny_string, SharedObject* > SharedObject::sharedobjectmap; -SharedObject::SharedObject(Class_base* c):EventDispatcher(c) +SharedObject::SharedObject(Class_base* c):EventDispatcher(c),client(this),objectEncoding(ObjectEncoding::AMF3) { data=_MR(new_asobject()); } @@ -619,12 +620,47 @@ { CLASS_SETUP_NO_CONSTRUCTOR(c, EventDispatcher, CLASS_SEALED); c->setDeclaredMethodByQName("getLocal","",Class<IFunction>::getFunction(getLocal),NORMAL_METHOD,false); + c->setDeclaredMethodByQName("getRemote","",Class<IFunction>::getFunction(getRemote),NORMAL_METHOD,false); c->setDeclaredMethodByQName("flush","",Class<IFunction>::getFunction(flush),NORMAL_METHOD,true); c->setDeclaredMethodByQName("clear","",Class<IFunction>::getFunction(clear),NORMAL_METHOD,true); + c->setDeclaredMethodByQName("close","",Class<IFunction>::getFunction(close),NORMAL_METHOD,true); + c->setDeclaredMethodByQName("connect","",Class<IFunction>::getFunction(connect),NORMAL_METHOD,true); + REGISTER_GETTER_SETTER(c,client); REGISTER_GETTER(c,data); + c->setDeclaredMethodByQName("defaultObjectEncoding","",Class<IFunction>::getFunction(_getDefaultObjectEncoding),GETTER_METHOD,false); + c->setDeclaredMethodByQName("defaultObjectEncoding","",Class<IFunction>::getFunction(_setDefaultObjectEncoding),SETTER_METHOD,false); + REGISTER_SETTER(c,fps); + REGISTER_GETTER_SETTER(c,objectEncoding); + c->setDeclaredMethodByQName("preventBackup","",Class<IFunction>::getFunction(_getPreventBackup),GETTER_METHOD,false); + c->setDeclaredMethodByQName("preventBackup","",Class<IFunction>::getFunction(_setPreventBackup),SETTER_METHOD,false); + c->setDeclaredMethodByQName("size","",Class<IFunction>::getFunction(_getSize),GETTER_METHOD,true); + + getSys()->staticSharedObjectDefaultObjectEncoding = ObjectEncoding::AMF3; + getSys()->staticSharedObjectPreventBackup = false; } +ASFUNCTIONBODY_GETTER_SETTER(SharedObject,client); ASFUNCTIONBODY_GETTER(SharedObject,data); +ASFUNCTIONBODY_SETTER(SharedObject,fps); +ASFUNCTIONBODY_GETTER_SETTER(SharedObject,objectEncoding); + +ASFUNCTIONBODY(SharedObject,_getDefaultObjectEncoding) +{ + return abstract_ui(getSys()->staticSharedObjectDefaultObjectEncoding); +} + +ASFUNCTIONBODY(SharedObject,_setDefaultObjectEncoding) +{ + assert_and_throw(argslen == 1); + uint32_t value = args[0]->toUInt(); + if(value == 0) + getSys()->staticSharedObjectDefaultObjectEncoding = ObjectEncoding::AMF0; + else if(value == 3) + getSys()->staticSharedObjectDefaultObjectEncoding = ObjectEncoding::AMF3; + else + throw RunTimeException("Invalid shared object encoding"); + return NULL; +} ASFUNCTIONBODY(SharedObject,getLocal) { @@ -648,11 +684,19 @@ it->second->incRef(); return it->second; } + +ASFUNCTIONBODY(SharedObject,getRemote) +{ + LOG(LOG_NOT_IMPLEMENTED,"SharedObject.getRemote not implemented"); + return NULL; +} + ASFUNCTIONBODY(SharedObject,flush) { LOG(LOG_NOT_IMPLEMENTED,"SharedObject.flush not implemented"); return NULL; } + ASFUNCTIONBODY(SharedObject,clear) { SharedObject* th=static_cast<SharedObject*>(obj); @@ -660,6 +704,39 @@ return NULL; } +ASFUNCTIONBODY(SharedObject,close) +{ + LOG(LOG_NOT_IMPLEMENTED, "SharedObject.close not implemented"); + return NULL; +} + +ASFUNCTIONBODY(SharedObject,connect) +{ + LOG(LOG_NOT_IMPLEMENTED, "SharedObject.connect not implemented"); + return NULL; +} + +ASFUNCTIONBODY(SharedObject,_getPreventBackup) +{ + return abstract_b(getSys()->staticSharedObjectPreventBackup); +} + +ASFUNCTIONBODY(SharedObject,_setPreventBackup) +{ + assert_and_throw(argslen == 1); + assert_and_throw(args[0]->getObjectType()==T_BOOLEAN); + bool value = Class<Boolean>::cast(args[0])->val; + getSys()->staticSharedObjectPreventBackup = value; + return NULL; +} + +ASFUNCTIONBODY(SharedObject,_getSize) +{ + /* Get the size of the objects in the sharedobjectmap */ + LOG(LOG_NOT_IMPLEMENTED, "SharedObject.size not implemented"); + return abstract_ui(0); +} + void ObjectEncoding::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructorNotInstantiatable, CLASS_FINAL | CLASS_SEALED); @@ -1416,7 +1493,7 @@ NetStream* th=Class<NetStream>::cast(obj); _NR<ByteArray> bytearray; ARG_UNPACK(bytearray); - + if(!bytearray.isNull()) { if (th->datagenerationfile) @@ -1555,6 +1632,7 @@ } if (!th->datagenerationthreadstarted && th->datagenerationfile->getReceivedLength() >= 8192) { + th->closed = false; th->datagenerationthreadstarted = true; th->incRef(); getSys()->addJob(th); @@ -1573,7 +1651,6 @@ if (val == "resetBegin") { th->threadAbort(); - th->closed = false; LOG(LOG_INFO,"resetBegin"); if (th->datagenerationfile) delete th->datagenerationfile; @@ -1700,7 +1777,7 @@ } istream s(sbuf); s.exceptions(istream::goodbit); - + ThreadProfile* profile=getSys()->allocateProfiler(RGB(0,0,200)); profile->setTag("NetStream"); bool waitForFlush=true; @@ -1717,11 +1794,14 @@ { streamDecoder=new BuiltinStreamDecoder(s,this); if (!streamDecoder->isValid()) // not FLV stream, so we try ffmpeg detection + { + s.seekg(0); streamDecoder=new FFMpegStreamDecoder(s); + } if(!streamDecoder->isValid()) threadAbort(); } - + countermutex.lock(); framesdecoded = 0; @@ -1743,6 +1823,12 @@ bool decodingSuccess= bufferfull && streamDecoder->decodeNextFrame(); if(!decodingSuccess && bufferfull) { + if (s.tellg() == -1) + { + done = true; + continue; + } + LOG(LOG_INFO,"decoding failed:"<<s.tellg()<<" "<<this->getReceivedLength()); bufferfull = false; }
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.h
Changed
@@ -112,9 +112,20 @@ SharedObject(Class_base* c); static void sinit(Class_base*); ASFUNCTION(getLocal); + ASFUNCTION(getRemote); ASFUNCTION(flush); ASFUNCTION(clear); + ASFUNCTION(close); + ASFUNCTION(connect); + ASPROPERTY_GETTER_SETTER(_R<ASObject>,client); ASPROPERTY_GETTER(_NR<ASObject>,data); + ASFUNCTION(_getDefaultObjectEncoding); + ASFUNCTION(_setDefaultObjectEncoding); + ASPROPERTY_SETTER(number_t,fps); + ASPROPERTY_GETTER_SETTER(uint32_t,objectEncoding); + ASFUNCTION(_getPreventBackup); + ASFUNCTION(_setPreventBackup); + ASFUNCTION(_getSize); }; class ObjectEncoding: public ASObject
View file
lightspark.tar.xz/src/scripting/flash/utils/Timer.cpp
Changed
@@ -142,10 +142,11 @@ th->stopMe=false; th->incRef(); th->tickJobInstance = _MNR(th); + // according to spec Adobe handles timers 60 times per second, so minimum delay is 17 ms if(th->repeatCount==1) - getSys()->addWait(th->delay,th); + getSys()->addWait(th->delay < 17 ? 17 : th->delay,th); else - getSys()->addTick(th->delay,th); + getSys()->addTick(th->delay < 17 ? 17 : th->delay,th); return NULL; }
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -2540,7 +2540,7 @@ node->namespacedefs.push_back(_MR(ns)); node->nodenamespace_uri = uri; } - else if (aname.substr_bytes(0,6) == "xmlns:") + else if (aname.numBytes() >= 6 && aname.substr_bytes(0,6) == "xmlns:") { tiny_string uri = itattr->value(); tiny_string prefix = aname.substr(6,aname.end());
View file
lightspark.tar.xz/src/swf.h
Changed
@@ -384,6 +384,8 @@ // NetConnection ObjectEncoding::ENCODING staticNetConnectionDefaultObjectEncoding; ObjectEncoding::ENCODING staticByteArrayDefaultObjectEncoding; + ObjectEncoding::ENCODING staticSharedObjectDefaultObjectEncoding; + bool staticSharedObjectPreventBackup; //enterFrame event management void registerFrameListener(_R<DisplayObject> clip);
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
.