修复windows下http-flv的bug

This commit is contained in:
xiongziliang 2018-01-23 15:42:09 +08:00
parent 82e3907dfa
commit 93a1b16305

View File

@ -597,6 +597,10 @@ void HttpSession::onSendMedia(const RtmpPacket::Ptr &pkt) {
sendRtmp(pkt->typeId, pkt->strBuf, modifiedStamp);
}
#if defined(_WIN32)
#pragma pack(push, 1)
#endif // defined(_WIN32)
class RtmpTagHeader {
public:
uint8_t type = 0;
@ -606,6 +610,10 @@ public:
uint8_t streamid[3] = {0}; /* Always 0. */
}PACKED;
#if defined(_WIN32)
#pragma pack(pop)
#endif // defined(_WIN32)
void HttpSession::sendRtmp(uint8_t ui8Type, const std::string& strBuf, uint32_t ui32TimeStamp) {
auto size = htonl(m_previousTagSize);
send((char *)&size,4);//send PreviousTagSize