I have an app that streams video using Kickflip and ButterflyTV libRTMP
Now for 99% percent of the time the app is working ok, but from time to time I get a native s
By symptom/description of the problem, your program is most likely experiencing some sort of invalid memory access/corruption which is somehow related with multi-thread race condition scenario. From my past experience, debugging memory corruption itself is very difficult and if it is linked to multi-thread environment it becomes very very difficult. Some of my previous post might be helpful and provide some general guidelines on these topics. Please note that these posts are related to Windows/Linux and not for Android platform.
cpp - valgrind - Invalid read of size 8
A segmentation fault sometimes occurs when the function cvCreateFileCapture is invoked on network URL
While reading further about similar issue and your code sinppet, I came across one post which is mentioned below:
What does SEGV_ACCERR mean?
Client code snippet of your application
synchronized (mWriteFence) {
if (!mConnected) {
continue;
}
if (frame.getFrameType() == Frame.VIDEO_FRAME) {
writeResult = mRTMPMuxer.writeVideo(frame.getData(), frame.getOffset(), frame.getSize(), frame.getTime());
calcVideoFpsAndBitrate(frame.getSize());
} else if (frame.getFrameType() == Frame.AUDIO_FRAME) {
writeResult = mRTMPMuxer.writeAudio(frame.getData(), frame.getOffset(), frame.getSize(), frame.getTime());
calcAudioBitrate(frame.getSize());
}
}
From above code, it appears to me that if your application receives Frame.VIDEO_FRAME & Frame.AUDIO_FRAME in certain order it might be leading to some sort of race condition(may be async model implementation) while using the frame variable within RtmpMuxerMix.writeThread module.
To conclude such issues:
.