wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
197 stars 31 forks source link

App Crash on iOS #83

Closed scottynoshotty closed 6 months ago

scottynoshotty commented 6 months ago

Been seeing this in a few crash reports, haven't repro'd locally but do have a full stack trace.

Thread 34 Crashed:
0   Flutter                         0x000000010b3f4230 0x10b3d8000 + 115248
1   Flutter                         0x000000010b402cb0 0x10b3d8000 + 175280
2   fvp                             0x0000000107357158 std::__1::__function::__value_func<void (void*)>::operator()[abi:ue170006](void*&&) const + 24 (function.h:518)
3   fvp                             0x0000000107357158 std::__1::function<void (void*)>::operator()(void*) const + 24 (function.h:1169)
4   fvp                             0x0000000107357158 mdk::Player::setRenderCallback(std::__1::function<void (void*)>)::'lambda'(void*, void*)::operator()(void*, void*) const + 24 (Player.h:571)
5   fvp                             0x0000000107357158 mdk::Player::setRenderCallback(std::__1::function<void (void*)>)::'lambda'(void*, void*)::__invoke(void*, void*) + 40 (Player.h:569)
6   mdk                             0x0000000109459864 std::__1::function<void (void*)>::operator()(void*) const + 24 (function.h:1156)
7   mdk                             0x000000010946de54 std::__1::function<void ()>::operator()() const + 4 (function.h:1156)
8   mdk                             0x000000010946de54 mdk::abi::VideoRenderer::update() + 84 (VideoOutput.cpp:443)
9   mdk                             0x000000010946dd70 mdk::abi::VideoRenderer::process(mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*) + 904 (__tree:0)
10  mdk                             0x000000010945c5dc mdk::abi::VideoPresenter::present(mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*) + 184 (VideoPresenter.cpp:556)
11  mdk                             0x00000001094375c0 std::__1::__function::__value_func<double (mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*)>::operator()[abi:v160006](mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*&&) const + 20 (function.h:510)
12  mdk                             0x00000001094375c0 std::__1::function<double (mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*)>::operator()(mdk::abi::VideoFrame const&, mdk::abi::RenderStatistics*) const + 36 (function.h:1156)
13  mdk                             0x0000000109438164 mdk::abi::MediaControlPush::onProcessed(mdk::abi::VideoFrame const&, int) + 1380 (MediaControl.cpp:1486)
14  mdk                             0x000000010943744c void mdk::abi::MediaControlPush::process<mdk::abi::VideoFrame>(mdk::abi::MediaControlPush::Proc<mdk::abi::VideoFrame>&, mdk::abi::VideoFrame const&, mdk::abi::VideoFrame&, int) + 276 (MediaControl.cpp:1171)
15  mdk                             0x000000010943744c mdk::abi::MediaControlPush::onVideoReadInThread(mdk::abi::VideoFrame&, int) + 1656 (MediaControl.cpp:1353)
16  mdk                             0x0000000109436d38 mdk::abi::MediaControlPush::onVideoRead(mdk::abi::VideoFrame const&, int) + 416 (MediaControl.cpp:1279)
17  mdk                             0x000000010943b20c mdk::abi::MediaControlPush::updateUniqueReaders()::$_3::operator()(mdk::abi::VideoFrame const&, int) const + 4 (MediaControl.cpp:632)
18  mdk                             0x000000010943b20c decltype(std::declval<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3&>()(std::declval<mdk::abi::VideoFrame const&>(), std::declval<int>())) std::__1::__invoke[abi:v160006]<mdk::abi::MediaCo... + 12 (invoke.h:394)
19  mdk                             0x000000010943b20c bool std::__1::__invoke_void_return_wrapper<bool, false>::__call<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3&, mdk::abi::VideoFrame const&, int>(mdk::abi::MediaControlPush::updateUniqueR... + 12 (invoke.h:478)
20  mdk                             0x000000010943b20c std::__1::__function::__alloc_func<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3, std::__1::allocator<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3>, bool (mdk::abi::VideoFrame co... + 12 (function.h:185)
21  mdk                             0x000000010943b20c std::__1::__function::__func<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3, std::__1::allocator<mdk::abi::MediaControlPush::updateUniqueReaders()::$_3>, bool (mdk::abi::VideoFrame const&, ... + 20 (function.h:356)
22  mdk                             0x000000010942475c std::__1::__function::__value_func<bool (mdk::abi::VideoFrame const&, int)>::operator()[abi:v160006](mdk::abi::VideoFrame const&, int&&) const + 20 (function.h:510)
23  mdk                             0x000000010942475c std::__1::function<bool (mdk::abi::VideoFrame const&, int)>::operator()(mdk::abi::VideoFrame const&, int) const + 20 (function.h:1156)
24  mdk                             0x000000010942475c bool mdk::abi::FrameReader::Private::frameAvailable<(mdk::abi::MediaType)0, mdk::abi::DecoderLoopTrait<(mdk::abi::MediaType)0> >(mdk::abi::DecoderLoopTrait<(mdk::abi::MediaType)0>::Frame&, int, mdk... + 176 (FrameReader.cpp:1046)
25  mdk                             0x000000010942475c bool mdk::abi::FrameReader::frameAvailable<mdk::abi::VideoFrame>(mdk::abi::VideoFrame&, int) const + 824 (FrameReader.cpp:1089)
26  mdk                             0x000000010941e66c bool mdk::abi::FrameReaderImpl::decodeLoop<(mdk::abi::MediaType)0>(int, int) + 2716 (FrameReader.cpp:2497)
27  mdk                             0x000000010941e66c mdk::abi::FrameReaderImpl::startDecodeThread(mdk::abi::FrameReaderImpl::DecLoopState&, mdk::abi::MediaType, int)::$_30::operator()() const + 5436 (FrameReader.cpp:2655)
28  mdk                             0x000000010941e66c decltype(std::declval<mdk::abi::FrameReaderImpl::startDecodeThread(mdk::abi::FrameReaderImpl::DecLoopState&, mdk::abi::MediaType, int)::$_30>()()) std::__1::__invoke[abi:v160006]<mdk::abi::FrameRea... + 5436 (invoke.h:394)
29  mdk                             0x000000010941e66c void std::__1::__thread_execute[abi:v160006]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mdk::abi::FrameReaderImpl::startDecodeThread(mdk:... + 5436 (thread:288)
30  mdk                             0x000000010941e66c void* std::__1::__thread_proxy[abi:v160006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, mdk::abi::FrameReaderImpl::startDe... + 9096 (thread:299)
31  libsystem_pthread.dylib         0x000000020e7144d4 _pthread_start + 136 (pthread.c:904)
32  libsystem_pthread.dylib         0x000000020e713a10 thread_start + 8
wang-bin commented 6 months ago

In your project dir, run

flutter clean
pod cache clean mdk
find . -name Podfile.lock -delete

then rebuild. There is a thread issue fixed in fvp dependency.

scottynoshotty commented 6 months ago

Thanks Wang, I think this issue is obsolete with that change. Closing.