harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.61k stars 168 forks source link

Is the RTMP chunk type not fully supported? #65

Closed udoless closed 7 months ago

udoless commented 8 months ago

I was looking at the code of the zip_chunk_header method, and it seems like the 'if' logic inside should never be executed (because self.csid_2_chunk_header is always empty and there is no assignment to it).

https://github.com/harlanc/xiu/blob/3a2faab9f8391fd8f294984405d5f68473a90391/protocol/rtmp/src/chunk/packetizer.rs#L37-L63

harlanc commented 8 months ago

Thanks for your report, you are right, some logics are missed and the Chunk header should be cached in the csid_2_chunk_header , could you do some fix and make a PR?

udoless commented 8 months ago

Thank you for the response. I'm not very familiar with this project right now, but I can give it a try if there's an opportunity in the future.

harlanc commented 8 months ago

I added the missing logic and did some simple tests, now different format types can be set for RTMP chunks, any other questions please let me know.