From 93a1b16305b44aa32005fef906ef20cb2f9d3a20 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 23 Jan 2018 15:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwindows=E4=B8=8Bhttp-flv?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpSession.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 02f01fb5..164674b1 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -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