diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index d857c40c..73a115cb 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -248,22 +248,12 @@ void RtmpSession::sendPlayResponse(const string &err,const RtmpMediaSource::Ptr invoke.clear(); invoke << "onMetaData" << metadata; sendResponse(MSG_DATA, invoke.data()); - auto duration = metadata["duration"]; - if(duration && duration.as_number() > 0){ - //这是点播,使用绝对时间戳 - _stamp[0].setPlayBack(); - _stamp[1].setPlayBack(); - } } - src->getConfigFrame([&](const RtmpPacket::Ptr &pkt) { - //DebugP(this)<<"send initial frame"; onSendMedia(pkt); }); - //音频同步于视频 - _stamp[0].syncTo(_stamp[1]); src->pause(false); _ring_reader = src->getRing()->attach(getPoller()); weak_ptr weakSelf = dynamic_pointer_cast(shared_from_this()); @@ -532,13 +522,9 @@ void RtmpSession::onCmd_seek(AMFDecoder &dec) { } void RtmpSession::onSendMedia(const RtmpPacket::Ptr &pkt) { - //rtmp播放器时间戳从零开始 - int64_t dts_out; - _stamp[pkt->type_id % 2].revise(pkt->time_stamp, 0, dts_out, dts_out); - sendRtmp(pkt->type_id, pkt->stream_index, pkt, (uint32_t)dts_out, pkt->chunk_id); + sendRtmp(pkt->type_id, pkt->stream_index, pkt, pkt->time_stamp, pkt->chunk_id); } - bool RtmpSession::close(MediaSource &sender,bool force) { //此回调在其他线程触发 if(!_publisher_src || (!force && _publisher_src->totalReaderCount())){ diff --git a/src/Rtmp/RtmpSession.h b/src/Rtmp/RtmpSession.h index e6e4cd0e..62626546 100644 --- a/src/Rtmp/RtmpSession.h +++ b/src/Rtmp/RtmpSession.h @@ -91,9 +91,8 @@ private: double _recv_req_id = 0; //消耗的总流量 uint64_t _total_bytes = 0; - std::string _tc_url; - //时间戳修整器 + //推流时间戳修整器 Stamp _stamp[2]; //数据接收超时计时器 Ticker _ticker;