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 113
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160814.1809 +Version: 0.7.2.99+git20160821.1502 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -238,12 +238,10 @@ } default: { - XMLList *xl=dynamic_cast<XMLList *>(r); - if(xl) - return xl->isEqual(this); - XML *x=dynamic_cast<XML *>(r); - if(x && x->hasSimpleContent()) - return x->toString()==toString(); + if (r->is<XMLList>()) + return r->as<XMLList>()->isEqual(this); + if (r->is<XML>() && r->as<XML>()->hasSimpleContent()) + return r->toString()==toString(); } } if (r->is<ObjectConstructor>())
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -318,17 +318,36 @@ { if(datalen==0) return false; - int frameOk=0; #if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME AVPacket pkt; av_init_packet(&pkt); pkt.data=data; pkt.size=datalen; int ret = avcodec_send_packet(codecContext, &pkt); - if (ret == 0) + while (ret == 0) + { ret = avcodec_receive_frame(codecContext,frameIn); - frameOk=1; -#elif HAVE_AVCODEC_DECODE_VIDEO2 + if (ret != 0) + { + if (ret != AVERROR(EAGAIN)) + { + LOG(LOG_INFO,"not decoded:"<<ret); + return false; + } + } + else + { + if(status==INIT && fillDataAndCheckValidity()) + status=VALID; + + assert(frameIn->pts==(int64_t)AV_NOPTS_VALUE || frameIn->pts==0); + + copyFrameToBuffers(frameIn, time); + } + } +#else + int frameOk=0; +#if HAVE_AVCODEC_DECODE_VIDEO2 AVPacket pkt; av_init_packet(&pkt); pkt.data=data; @@ -353,19 +372,39 @@ copyFrameToBuffers(frameIn, time); } +#endif return true; } bool FFMpegVideoDecoder::decodePacket(AVPacket* pkt, uint32_t time) { - int frameOk=0; - #if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME int ret = avcodec_send_packet(codecContext, pkt); - if (ret == 0) + while (ret == 0) + { ret = avcodec_receive_frame(codecContext,frameIn); - frameOk=1; -#elif HAVE_AVCODEC_DECODE_VIDEO2 + if (ret != 0) + { + if (ret != AVERROR(EAGAIN)) + { + LOG(LOG_INFO,"not decoded:"<<ret); + return false; + } + } + else + { + if(status==INIT && fillDataAndCheckValidity()) + status=VALID; + + assert(frameIn->pts==(int64_t)AV_NOPTS_VALUE || frameIn->pts==0); + + copyFrameToBuffers(frameIn, time); + } + } +#else + int frameOk=0; + +#if HAVE_AVCODEC_DECODE_VIDEO2 int ret=avcodec_decode_video2(codecContext, frameIn, &frameOk, pkt); #else int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, pkt->data, pkt->size); @@ -388,6 +427,7 @@ copyFrameToBuffers(frameIn, time); } +#endif return true; } @@ -697,9 +737,7 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t time) { - FrameSamples& curTail=samplesBuffer.acquireLast(); - int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; -#if HAVE_AVCODEC_DECODE_AUDIO3 || HAVE_AVCODEC_DECODE_AUDIO4 || (HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME) +#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME AVPacket pkt; av_init_packet(&pkt); @@ -720,20 +758,71 @@ pkt.size = combinedBuffer.size(); overflowBuffer.clear(); } -#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME av_frame_unref(frameIn); int ret = avcodec_send_packet(codecContext, &pkt); - if (ret == 0) + int maxLen = 0; + while (ret == 0) + { + ret = avcodec_receive_frame(codecContext,frameIn); - if(ret<0) + + if(ret != 0) + { + if (ret != AVERROR(EAGAIN)) + LOG(LOG_ERROR,"not decoded audio:"<<ret ); + } + else + { + FrameSamples& curTail=samplesBuffer.acquireLast(); + int len = resampleFrameToS16(curTail); + maxLen = pkt.size - av_frame_get_pkt_size (frameIn); + curTail.len=len; + assert(!(curTail.len&0x80000000)); + assert(len%2==0); + curTail.current=curTail.samples; + curTail.time=time; + samplesBuffer.commitLast(); + if(status==INIT && fillDataAndCheckValidity()) + status=VALID; + } + } + if (maxLen > 0) { - LOG(LOG_ERROR,"not decoded audio:"<<ret); + int tmpsize = pkt.size - maxLen; + uint8_t* tmpdata = pkt.data; + tmpdata += maxLen; + + if (tmpsize > 0) + { + overflowBuffer.assign(tmpdata , tmpdata+tmpsize); + } + } + return maxLen; +#else + FrameSamples& curTail=samplesBuffer.acquireLast(); + int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; +#if HAVE_AVCODEC_DECODE_AUDIO3 || HAVE_AVCODEC_DECODE_AUDIO4 + AVPacket pkt; + av_init_packet(&pkt); + + // If some data was left unprocessed on previous call, + // concatenate. + std::vector<uint8_t> combinedBuffer; + if (overflowBuffer.empty()) + { + pkt.data=data; + pkt.size=datalen; } else { - maxLen = resampleFrameToS16(curTail); + combinedBuffer.assign(overflowBuffer.begin(), overflowBuffer.end()); + if (datalen > 0) + combinedBuffer.insert(combinedBuffer.end(), data, data+datalen); + pkt.data = &combinedBuffer[0]; + pkt.size = combinedBuffer.size(); + overflowBuffer.clear(); } -#elif HAVE_AVCODEC_DECODE_AUDIO4 +#if HAVE_AVCODEC_DECODE_AUDIO4 av_frame_unref(frameIn); int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); @@ -775,27 +864,43 @@ status=VALID; return maxLen; +#endif } uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) { - FrameSamples& curTail=samplesBuffer.acquireLast(); - int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; - #if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME av_frame_unref(frameIn); int ret = avcodec_send_packet(codecContext, pkt); - if (ret == 0) - ret = avcodec_receive_frame(codecContext,frameIn);
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -2075,6 +2075,15 @@ _NR<ASObject> tmpo=obj->getVariableByMultiname(*mname,ASObject::SKIP_IMPL); if(!tmpo.isNull()) return; + + //Check if this already defined in parent applicationdomains + ASObject* target; + ASObject* oldDefinition=root->applicationDomain->getVariableAndTargetByMultiname(*mname, target); + if(oldDefinition && oldDefinition->getObjectType()==T_CLASS) + { + return; + } + ASObject* ret; QName className(mname->name_s_id,mname->ns[0].getImpl(obj->getSystemState()).nameId);
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -2489,13 +2489,11 @@ { if (!isConstructed()) return !r->isConstructed() || r->getObjectType() == T_NULL || r->getObjectType() == T_UNDEFINED; - XML *x=dynamic_cast<XML *>(r); - if(x) - return nodesEqual(this, x); + if(r->is<XML>()) + return nodesEqual(this, r->as<XML>()); - XMLList *xl=dynamic_cast<XMLList *>(r); - if(xl) - return xl->isEqual(this); + if(r->is<XMLList>()) + return r->as<XMLList>()->isEqual(this); if(hasSimpleContent()) return toString()==r->toString();
View file
lightspark.tar.xz/src/scripting/toplevel/XMLList.cpp
Changed
@@ -692,11 +692,10 @@ for(; it!=nodes.end(); ++it) { _NR<ASObject> o=(*it)->getVariableByMultiname(name,opt); - XMLList *x=dynamic_cast<XMLList *>(o.getPtr()); - if(!x) + if(!o->is<XMLList>()) continue; - retnodes.insert(retnodes.end(), x->nodes.begin(), x->nodes.end()); + retnodes.insert(retnodes.end(), o->as<XMLList>()->nodes.begin(), o->as<XMLList>()->nodes.end()); } if(retnodes.size()==0 && (opt & XML_STRICT)!=0) @@ -720,11 +719,10 @@ for(; it!=nodes.end(); ++it) { _NR<ASObject> o=(*it)->getVariableByMultiname(name,opt); - XMLList *x=dynamic_cast<XMLList *>(o.getPtr()); - if(!x) + if(!o->is<XMLList>()) continue; - retnodes.insert(retnodes.end(), x->nodes.begin(), x->nodes.end()); + retnodes.insert(retnodes.end(), o->as<XMLList>()->nodes.begin(), o->as<XMLList>()->nodes.end()); } if(retnodes.size()==0 && (opt & XML_STRICT)!=0) @@ -1159,14 +1157,13 @@ if(nodes.size()==0 && r->getObjectType()==T_UNDEFINED) return true; - XMLList *x=dynamic_cast<XMLList *>(r); - if(x) + if(r->is<XMLList>()) { - if(nodes.size()!=x->nodes.size()) + if(nodes.size()!=r->as<XMLList>()->nodes.size()) return false; for(unsigned int i=0; i<nodes.size(); i++) - if(!nodes[i]->isEqual(x->nodes[i].getPtr())) + if(!nodes[i]->isEqual(r->as<XMLList>()->nodes[i].getPtr())) return false; return true;
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
.