Comments (3)
HI,
Yes I could reproduce this bug. So far I noticed it only for remote streams.
The rought way to workaround it, call closeFile method for _decoder in UIApplicationDidEnterBackgroundNotification.
I will look into problem in more detail and maybe there are another solution.
-
after some googling, there is another solution: just add somewhere
signal(SIGPIPE, SIG_IGN)
Best wishes.
from kxmovie.
Hi,
Thanks for the suggestions; I have tried the proposed solutions (using both closeFile and SIG_IGN), but still crashes (also on different sections of the code inside [KxMovieDecoder decodeFrames]. I just tried now (play stream, then switch to different app or lock/unlock screen for e.g.) , and got a EXC_BAD_ACCESS inside decodeFrames > av_read_frame_read_frame_internal > ff_read_packet > rtsp_read_packet > ff_rtsp_fetch_packet > furl_get_file_handle.
Sometimes it crashes, sometimes it doesn't; It seems that it depends on which part of the code the execution is when we hit the lock button.
Further tests show that even if we insert the signal(SIGPIPE, SIG_IGN) code, sigpipe is not ignored (still crashes with SIGPIPE for example at KxMovieDecoder closeFile > avformat_close_input > rtsp_read_close > ff_rtsp_send_cmd_async > ff_rtsp_sendcmd_with_content_async > ffurl_write > retry_transfer_wrapper > tcp_write at tcp.c). My guess is that ffmpeg is overriding the flag at another point inside its code.
In a quick test I did manage to make it work (that is, go to background and back to foreground by switching applications with the double-tap in main button, lock / unlock screen etc) and restore playback without crashing, but not in a way that I could properly deallocate the ffmpeg objects (ended up removing [self closeFile] from KxMovieDecoder's dealloc - not a memory-friendly idea at all) ..
I do can manage to properly dispose the objects in any other method within the app, but specifically not within UIApplicationDidEnterBackgroundNotification or applicationWillResignActive or applicationDidEnterBackground for example. I know that iOS will give a little time (not sure how long) for execution inside these calls, so the "intuition" I have is that although iOS gives some "time" for tasks after the user locked the phone to be executed, this time is not being enough to dispose ffmpeg the way it is being done right now (but this is just a supposition I have now).
from kxmovie.
I have this same issue. Are there any further suggestions?
I am playing a local file in my case.
from kxmovie.
Related Issues (20)
- 编译失败,原因如下,bitcode设置为NO后有别的库报错。有没有包含bitcode的库呢?
- 如何设置kxmovie打开视频的宽高比?以16:9或者4:3打开
- iphone5, iOS 10.3.2 can't play
- FFMpeg读取内存数据NSData用了AVIOContext * avio_in =avio_alloc_context(inbuffer,32768*20,0,NULL,read_buffer,NULL,NULL)
- Cannot make project run HOT 5
- 不支持 rtp 吗,如果支持的话,怎么设置sdp文件呢 HOT 9
- Bult failed HOT 1
- 支持h265么?硬解怎么设置??
- 'libavutil/avconfig.h' file not found HOT 1
- 编译起来到处报错........................... HOT 7
- How to customise kxmovie player
- 支持h265吗?
- rake failed HOT 1
- rake fail HOT 1
- 声音卡顿问题 播放卡顿
- add filter
- Suggestion
- 你好,我的场景是:iOS需要播放加密的m3u8文件,后台把每个ts地址进行加密,客户端进行解密后播放,请问支持吗?现在解密每个ts已实现,该怎么播放?希望得到您的帮助。 HOT 1
- 关于版权
- Need to feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kxmovie.