SVGAGlidePlugin icon indicating copy to clipboard operation
SVGAGlidePlugin copied to clipboard

有一张svga图,一播放整个项目就卡住了,有时间的话,可以帮忙看一下是什么原因吗?

Open clbDream opened this issue 2 years ago • 3 comments

    GlideApp.with(this)
        .asSVGA()
        .load("https://bbyy0108.oss-cn-shanghai.aliyuncs.com/gift/svga/%E4%B8%96%E7%BA%AA%E5%A9%9A%E7%A4%BC.svga")

// .load("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true") .into(SVGATarget(iv_img, requestDynamicItemWithSpannableText()))

clbDream avatar Mar 14 '22 06:03 clbDream

image

clbDream avatar Mar 14 '22 06:03 clbDream

2022-03-14 14:44:55.778 28305-30042/com.yy.mobile.svga.glideplugin.demo E/AndroidRuntime: FATAL EXCEPTION: Thread-4
    Process: com.yy.mobile.svga.glideplugin.demo, PID: 28305
    java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 39464 free bytes and 38KB until OOM, target footprint 268435456, growth limit 268435456; failed due to fragmentation (largest possible contiguous allocation 86507520 bytes)
        at com.opensource.svgaplayer.SVGAVideoSpriteFrameEntity.<init>(SVGAVideoSpriteFrameEntity.kt:99)
        at com.opensource.svgaplayer.SVGAVideoSpriteEntity.<init>(SVGAVideoSpriteEntity.kt:40)
        at com.opensource.svgaplayer.SVGAVideoEntity.resetSprites(SVGAVideoEntity.kt:125)
        at com.opensource.svgaplayer.SVGAVideoEntity.<init>(SVGAVideoEntity.kt:61)
        at com.opensource.svgaplayer.SVGAParser.parse(SVGAParser.kt:182)
        at com.opensource.svgaplayer.SVGAParser.access$parse(SVGAParser.kt:25)
        at com.opensource.svgaplayer.SVGAParser$parse$3.invoke(SVGAParser.kt:95)
        at com.opensource.svgaplayer.SVGAParser$parse$3.invoke(SVGAParser.kt:25)
        at com.opensource.svgaplayer.SVGAParser$FileDownloader$resume$1.run(SVGAParser.kt:61)
        at java.lang.Thread.run(Thread.java:923)

用SVGAParser本身也会崩溃,提Issue给 https://github.com/svga/SVGAPlayer-Android

YvesCheung avatar Mar 14 '22 06:03 YvesCheung

java.lang.StackOverflowError: stack size 1043KB
        at com.squareup.wire.internal.ImmutableList.get(ImmutableList.java:38)
        at java.util.AbstractList$Itr.next(AbstractList.java:371)
        at java.util.AbstractCollection.contains(AbstractCollection.java:102)
        at com.squareup.wire.internal.Internal.immutableCopyOf(Internal.java:61)
        at com.opensource.svgaplayer.proto.SpriteEntity.<init>(SpriteEntity.java:64)
        at com.opensource.svgaplayer.proto.SpriteEntity$Builder.build(SpriteEntity.java:149)
        at com.opensource.svgaplayer.proto.SpriteEntity$ProtoAdapter_SpriteEntity.decode(SpriteEntity.java:191)
        at com.opensource.svgaplayer.proto.SpriteEntity$ProtoAdapter_SpriteEntity.decode(SpriteEntity.java:153)
        at com.opensource.svgaplayer.proto.MovieEntity$ProtoAdapter_MovieEntity.decode(MovieEntity.java:242)
        at com.opensource.svgaplayer.proto.MovieEntity$ProtoAdapter_MovieEntity.decode(MovieEntity.java:206)
        at com.squareup.wire.ProtoAdapter.decode(ProtoAdapter.java:203)
        at com.squareup.wire.ProtoAdapter.decode(ProtoAdapter.java:185)
        at com.opensource.svgaplayer.SVGAParser$decodeFromInputStream$1.run(SVGAParser.kt:311)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

迭代SpriteEntity.frames的时候栈爆了,这个资源是有多少桢.....

YvesCheung avatar Mar 14 '22 07:03 YvesCheung