mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 19:40:24 +00:00
RTSP: support stream redirect
When the client doesn't call TEARDOWN (like ffplay doesn't), the stream could not have been played until the timeout (given by `reclamationTestSeconds`). After that (or when TEARDOWN was called), `BasicRTSPOnlySubsession::deleteStream()` is called allowing the new stream. After this change, the stream can be redirected withot explicit TEARDOWN or timeout.
This commit is contained in:
@@ -89,8 +89,6 @@ char const* BasicRTSPOnlySubsession::sdpLines() {
|
||||
if (fSDPLines == NULL) {
|
||||
setSDPLines();
|
||||
}
|
||||
if (Adestination != NULL || Vdestination != NULL)
|
||||
return NULL;
|
||||
return fSDPLines;
|
||||
}
|
||||
|
||||
@@ -189,7 +187,7 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */
|
||||
netAddressBits& destinationAddress, uint8_t& /*destinationTTL*/,
|
||||
Boolean& /* isMulticast */, Port& serverRTPPort, Port& serverRTCPPort,
|
||||
void*& /* streamToken */) {
|
||||
if (Vdestination == NULL && (avType == video || avType == av)) {
|
||||
if (avType == video || avType == av) {
|
||||
Port rtp(rtp_port);
|
||||
serverRTPPort = rtp;
|
||||
Port rtcp(rtp_port + 1);
|
||||
@@ -203,10 +201,11 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */
|
||||
}
|
||||
struct in_addr destinationAddr;
|
||||
destinationAddr.s_addr = destinationAddress;
|
||||
delete Vdestination;
|
||||
Vdestination = new Destinations(destinationAddr, clientRTPPort,
|
||||
clientRTCPPort);
|
||||
}
|
||||
if (Adestination == NULL && (avType == audio || avType == av)) {
|
||||
if (avType == audio || avType == av) {
|
||||
Port rtp(rtp_port_audio);
|
||||
serverRTPPort = rtp;
|
||||
Port rtcp(rtp_port_audio + 1);
|
||||
@@ -220,6 +219,7 @@ void BasicRTSPOnlySubsession::getStreamParameters(unsigned /* clientSessionId */
|
||||
}
|
||||
struct in_addr destinationAddr;
|
||||
destinationAddr.s_addr = destinationAddress;
|
||||
delete Adestination;
|
||||
Adestination = new Destinations(destinationAddr, clientRTPPort,
|
||||
clientRTCPPort);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user