Open fatalfeel opened 2 years ago
Are you suggesting replacing this block with just packets.emplace(id,pkt); ? I agree this code is bad... as soon as we go out of scope, tmp_pkt gets freed... packets.emplace has to either copy or take ownership. Seems like maybe a shared_ptr approach would be good.
fixed i put my patch here http://fatalfeel.blogspot.com/2013/12/rtsp-server-for-h264-h265-aac.html
I fix a lot of it i compare it with live555-latest.tar.gz all raw bytes sendto now they are the same full code is stable also can play video and audio at the same time I sent to ur email ,done here is my demo: https://drive.google.com/file/d/1ZlD7SWmovdHL2XCxAmtjuEziGfH8YdJv/view
ps: Technology brings happiness to mankind Albert Einstein: The release of atom power has changed everything except our way of thinking... the solution to this problem lies in the heart of mankind. If only I had known, I should have become a watchmaker. https://atomictrauma.wordpress.com/the-scientists/albert-einstein
Please learn about Pull Requests. (PR)s. It saves a lot of time and effort for everyone.
i will try~~~~tks~
we found this problem, then saw this issue by today nice job!
thank you man ~ hawuwu163
reason because memcpy(tmp_pkt.data.get(), pkt.data.get(), pkt.size); -> need time and make slow sendto better be no copy, just copy data pointer
//in MediaSession::AddSource tmp_pkt.data = pkt.data; memcpy(tmp_pkt.data.get(), pkt.data.get(), pkt.size); tmp_pkt.size = pkt.size; tmp_pkt.last = pkt.last; tmp_pkt.timestamp = pkt.timestamp; tmp_pkt.type = pkt.type; packets.emplace(id, tmp_pkt);