Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit c50db25

Browse files
authored
Remove av_read_play which already called inside rtsp (#1093)
Some rtsp server will handle the second PLAY request as error and disconnect the TCP connection, it will cause the stream disconnect and trigger the reconnect mechnism in LiveStream, continue to disconnect and reconnect. Signed-off-by: Yu, Dingfeng <[email protected]>
1 parent 1b74d3e commit c50db25

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/core/owt_base/LiveStreamIn.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,9 @@ bool LiveStreamIn::connect()
741741

742742
m_AsyncEvent << "}";
743743

744-
av_read_play(m_context);
744+
if (m_context->iformat->read_play == nullptr) {
745+
av_read_play(m_context);
746+
}
745747

746748
if (m_videoJitterBuffer) {
747749
m_videoJitterBuffer->start();
@@ -851,7 +853,9 @@ bool LiveStreamIn::reconnect()
851853
if (m_isFileInput)
852854
m_timstampOffset = m_lastTimstamp + 1;
853855

854-
av_read_play(m_context);
856+
if (m_context->iformat->read_play == nullptr) {
857+
av_read_play(m_context);
858+
}
855859

856860
if (m_videoJitterBuffer)
857861
m_videoJitterBuffer->start();

0 commit comments

Comments
 (0)