PHZ76 / RtspServer

RTSP Server , RTSP Pusher
MIT License
997 stars 356 forks source link

when send h265 1280x720 ffplay video will block broken #77

Open fatalfeel opened 2 years ago

fatalfeel commented 2 years ago

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);

connortechnology commented 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.

fatalfeel commented 2 years ago

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

connortechnology commented 2 years ago

Please learn about Pull Requests. (PR)s. It saves a lot of time and effort for everyone.

fatalfeel commented 2 years ago

i will try~~~~tks~

hawuwu163 commented 2 years ago

we found this problem, then saw this issue by today nice job!

fatalfeel commented 2 years ago

thank you man ~ hawuwu163