muxer: set observer before we start waiting for read
If nobody ever reads the buffer before stop is called, MediaAdapter will go ahead and release mCurrentMediaBuffer. If it doesn't have an observer set, it will crash as it does have a refcount of 1. This can happen when the writer thread encountered an error and calls stop early, in this case it will never read the pending buffer. bug: 70348810 Test: - CTS MediaRecorderTest, MediaMuxerTest - Hacked framework to produce a similar crash as in b/70348810 and verified no crash in stagefright. Change-Id: Ia2017e6a13fca279c9603afe53ab6013b9c669f5
Loading
Please register or sign in to comment