Low Efficiency of This Project.
This project uses too many locks, conditions, semaphores to do sync or lock work. When append decode data, you locked,When consume data ,you locked, when codec change, you wait, etc.In my opinion, you can just use open, read,and close queue to do all works, and use ringbuffer to free lock when write and read decode data. And another thing, the whole project is protocol based, but as for me, there are too much protocol to make this project hard to read, to understand and to debug. As experiment, I made some change to MEPlayerItem, combine av_read_frame and following decode process together, change DataArray to ringbuffer. you guess what, for audio play only, the CPU usage decrease by 20%.
And, metioned by other guys too, if you want to play multi media in a playlist, This project is not a good option, because from code view, there are a lot work to do to support this feature.
This project has potential, but a long way to go.
Thank you for your suggestion. There is indeed a lot of room for optimization. I am the only one who is currently maintaining this project, so it is relatively slow to solve the problem, and more people are welcome to maintain it together.
@eximpression please create pull request with you changes.
@eximpression I optimized it and used ringbuffer. Then synchronous decoding is also supported. You can also help with optimization