Commit cded823b by xiongziliang

ps rtp推流优化音视频时间戳同步问题

parent 1970f601
...@@ -233,11 +233,10 @@ static const char *getCodecName(int codec_id) { ...@@ -233,11 +233,10 @@ static const char *getCodecName(int codec_id) {
void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t dts,const void *data,int bytes) { void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t dts,const void *data,int bytes) {
pts /= 90; pts /= 90;
dts /= 90; dts /= 90;
_stamps[codecid].revise(dts,pts,dts,pts,false); _dts = dts;
switch (codecid) { switch (codecid) {
case PSI_STREAM_H264: { case PSI_STREAM_H264: {
_dts = dts;
if (!_codecid_video) { if (!_codecid_video) {
//获取到视频 //获取到视频
_codecid_video = codecid; _codecid_video = codecid;
...@@ -262,7 +261,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d ...@@ -262,7 +261,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d
} }
case PSI_STREAM_H265: { case PSI_STREAM_H265: {
_dts = dts;
if (!_codecid_video) { if (!_codecid_video) {
//获取到视频 //获取到视频
_codecid_video = codecid; _codecid_video = codecid;
...@@ -285,7 +283,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d ...@@ -285,7 +283,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d
} }
case PSI_STREAM_AAC: { case PSI_STREAM_AAC: {
_dts = dts;
if (!_codecid_audio) { if (!_codecid_audio) {
//获取到音频 //获取到音频
_codecid_audio = codecid; _codecid_audio = codecid;
...@@ -304,7 +301,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d ...@@ -304,7 +301,6 @@ void RtpProcess::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d
case PSI_STREAM_AUDIO_G711A: case PSI_STREAM_AUDIO_G711A:
case PSI_STREAM_AUDIO_G711U: { case PSI_STREAM_AUDIO_G711U: {
_dts = dts;
auto codec = codecid == PSI_STREAM_AUDIO_G711A ? CodecG711A : CodecG711U; auto codec = codecid == PSI_STREAM_AUDIO_G711A ? CodecG711A : CodecG711U;
if (!_codecid_audio) { if (!_codecid_audio) {
//获取到音频 //获取到音频
......
...@@ -62,7 +62,6 @@ private: ...@@ -62,7 +62,6 @@ private:
MultiMediaSourceMuxer::Ptr _muxer; MultiMediaSourceMuxer::Ptr _muxer;
std::shared_ptr<FrameMerger> _merger; std::shared_ptr<FrameMerger> _merger;
Ticker _last_rtp_time; Ticker _last_rtp_time;
unordered_map<int,Stamp> _stamps;
uint32_t _dts = 0; uint32_t _dts = 0;
Decoder::Ptr _decoder; Decoder::Ptr _decoder;
std::weak_ptr<MediaSourceEvent> _listener; std::weak_ptr<MediaSourceEvent> _listener;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论