Merge remote-tracking branch 'origin/master'

This commit is contained in:
xiongziliang 2020-07-16 10:41:28 +08:00
commit 7f8aa7b3d6

View File

@ -380,7 +380,12 @@ string RtmpSession::getStreamId(const string &str){
//vlc和ffplay在播放 rtmp://127.0.0.1/record/0.mp4时 //vlc和ffplay在播放 rtmp://127.0.0.1/record/0.mp4时
//传过来的url会是rtmp://127.0.0.1/record/mp4:0, //传过来的url会是rtmp://127.0.0.1/record/mp4:0,
//我们在这里还原成0.mp4 //我们在这里还原成0.mp4
stream_id = stream_id.substr(pos + 1) + "." + stream_id.substr(0,pos); //实际使用时发现vlcmpv等会传过来rtmp://127.0.0.1/record/mp4:0.mp4,这里做个判断
auto ext = stream_id.substr(0,pos);
stream_id = stream_id.substr(pos + 1);
if(stream_id.find(ext) == string::npos){
stream_id = stream_id + "." + ext;
}
} }
if(params.empty()){ if(params.empty()){