jgh- / VideoCore-Inactive

*No longer in development* Please see https://github.com/unpause-live/SwiftVideo
MIT License
1.48k stars 538 forks source link

Crash when flipping camera while streaming occasionally #183

Open Skaggivara opened 9 years ago

Skaggivara commented 9 years ago

Application Specific Information: *\ Terminating app due to uncaught exception 'std::bad_alloc', reason: 'std::bad_alloc'

Last Exception Backtrace: 0 libc++abi.dylib 0x0000000195bddbb4 std::terminate(void (_)()) + 12 1 libc++abi.dylib 0x0000000195bdd478 __cxa_throw + 132 2 libc++.1.dylib 0x0000000195ba6314 operator new(unsigned long) + 88 3 Speakerbox 0x000000010028b260 std::1::vector<unsigned char, std::_1::allocator >::reserve(unsigned long) (new:156) 4 Speakerbox 0x0000000100280e0c videocore::rtmp::H264Packetizer::pushBuffer(unsigned char const, unsigned long, videocore::IMetadata&) (H264Packetizer.cpp:96) 5 Speakerbox 0x000000010028cd10 videocore::Split::pushBuffer(unsigned char const, unsigned long, videocore::IMetadata&) (Split.cpp:73) 6 Speakerbox 0x0000000100280358 videocore::Apple::H264Encode::compressionSessionOutput(unsigned char const, unsigned long, unsigned long long, unsigned long long) (H264Encode.mm:268) 7 Speakerbox 0x0000000100280248 videocore::Apple::vtCallback(void, void, int, unsigned int, opaqueCMSampleBuffer*) (H264Encode.mm:99) 8 VideoToolbox 0x0000000189b4dd5c __vtcsr_handleDeadServerConnection_block_invoke + 120 9 libdispatch.dylib 0x0000000196a71994 _dispatch_call_block_and_release + 20 10 libdispatch.dylib 0x0000000196a71954 _dispatch_client_callout + 12 11 libdispatch.dylib 0x0000000196a7c0a4 _dispatch_queue_drain + 1444 12 libdispatch.dylib 0x0000000196a74a5c _dispatch_queue_invoke + 128 13 libdispatch.dylib 0x0000000196a7e318 _dispatch_root_queue_drain + 716 14 libdispatch.dylib 0x0000000196a7fc4c _dispatch_worker_thread3 + 104 15 libsystem_pthread.dylib 0x0000000196c5121c _pthread_wqthread + 812 16 libsystem_pthread.dylib 0x0000000196c50ee0 start_wqthread + 0

Do I need to do anything else than the following when switching camera to guard against crashes:

jgh- commented 9 years ago

That crash doesn't appear to have anything to do with the camera, so it's curious that it happens when flipping the camera....