mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 00:47:34 +08:00
全面整理代码,去除编译警告
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
||||
*
|
||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
||||
*
|
||||
* Use of this source code is governed by MIT license that can be found in the
|
||||
* LICENSE file in the root of the source tree. All contributing project authors
|
||||
@@ -59,8 +59,8 @@ void FlvMuxer::start(const EventPoller::Ptr &poller,const RtmpMediaSource::Ptr &
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int size = pkt->size();
|
||||
size_t i = 0;
|
||||
auto size = pkt->size();
|
||||
pkt->for_each([&](const RtmpPacket::Ptr &rtmp){
|
||||
strongSelf->onWriteRtmp(rtmp, ++i == size);
|
||||
});
|
||||
@@ -140,14 +140,14 @@ void FlvMuxer::onWriteFlvTag(const RtmpPacket::Ptr &pkt, uint32_t time_stamp , b
|
||||
void FlvMuxer::onWriteFlvTag(uint8_t type, const Buffer::Ptr &buffer, uint32_t time_stamp, bool flush) {
|
||||
RtmpTagHeader header;
|
||||
header.type = type;
|
||||
set_be24(header.data_size, buffer->size());
|
||||
set_be24(header.data_size, (uint32_t)buffer->size());
|
||||
header.timestamp_ex = (uint8_t) ((time_stamp >> 24) & 0xff);
|
||||
set_be24(header.timestamp, time_stamp & 0xFFFFFF);
|
||||
//tag header
|
||||
onWrite(std::make_shared<BufferRaw>((char *)&header, sizeof(header)), false);
|
||||
//tag data
|
||||
onWrite(buffer, false);
|
||||
auto size = htonl((buffer->size() + sizeof(header)));
|
||||
uint32_t size = htonl((uint32_t)(buffer->size() + sizeof(header)));
|
||||
//PreviousTagSize
|
||||
onWrite(std::make_shared<BufferRaw>((char *)&size,4), flush);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ void FlvMuxer::onWriteFlvTag(uint8_t type, const Buffer::Ptr &buffer, uint32_t t
|
||||
void FlvMuxer::onWriteRtmp(const RtmpPacket::Ptr &pkt,bool flush) {
|
||||
int64_t dts_out;
|
||||
_stamp[pkt->type_id % 2].revise(pkt->time_stamp, 0, dts_out, dts_out);
|
||||
onWriteFlvTag(pkt, dts_out,flush);
|
||||
onWriteFlvTag(pkt, (uint32_t)dts_out,flush);
|
||||
}
|
||||
|
||||
void FlvMuxer::stop() {
|
||||
|
||||
Reference in New Issue
Block a user