rtsp点播恢复时不带range

This commit is contained in:
baiyfcu 2024-04-03 15:46:02 +08:00
parent 6b1b9f3e35
commit e7eae11891
1 changed files with 3 additions and 4 deletions

View File

@ -426,9 +426,8 @@ void RtspPlayer::sendPause(int type, uint32_t seekMS) {
// 开启或暂停rtsp // 开启或暂停rtsp
switch (type) { switch (type) {
case type_pause: sendRtspRequest("PAUSE", _control_url, {}); break; case type_pause: sendRtspRequest("PAUSE", _control_url, {}); break;
case type_play: case type_play: sendRtspRequest("PLAY", _control_url);
// sendRtspRequest("PLAY", _content_base); break;
// break;
case type_seek: case type_seek:
sendRtspRequest("PLAY", _control_url, { "Range", StrPrinter << "npt=" << setiosflags(ios::fixed) << setprecision(2) << seekMS / 1000.0 << "-" }); sendRtspRequest("PLAY", _control_url, { "Range", StrPrinter << "npt=" << setiosflags(ios::fixed) << setprecision(2) << seekMS / 1000.0 << "-" });
break; break;
@ -440,7 +439,7 @@ void RtspPlayer::sendPause(int type, uint32_t seekMS) {
} }
void RtspPlayer::pause(bool bPause) { void RtspPlayer::pause(bool bPause) {
sendPause(bPause ? type_pause : type_seek, getProgressMilliSecond()); sendPause(bPause ? type_pause : type_play, getProgressMilliSecond());
} }
void RtspPlayer::speed(float speed) { void RtspPlayer::speed(float speed) {