mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Adjust RTSP requests to conform to GFE 3.22 changes
This commit is contained in:
parent
9a706fd78c
commit
9b194cc700
@ -12,6 +12,7 @@ static bool hasSessionId;
|
||||
static int rtspClientVersion;
|
||||
static char urlAddr[URLSAFESTRING_LEN];
|
||||
static bool useEnet;
|
||||
static const char* controlStreamId;
|
||||
|
||||
static SOCKET sock = INVALID_SOCKET;
|
||||
static ENetHost* client;
|
||||
@ -418,7 +419,8 @@ static bool sendVideoAnnounce(PRTSP_MESSAGE response, int* error) {
|
||||
|
||||
*error = -1;
|
||||
|
||||
ret = initializeRtspRequest(&request, "ANNOUNCE", "streamid=video");
|
||||
ret = initializeRtspRequest(&request, "ANNOUNCE",
|
||||
APP_VERSION_AT_LEAST(7, 1, 431) ? controlStreamId : "streamid=video");
|
||||
if (ret) {
|
||||
ret = false;
|
||||
|
||||
@ -604,6 +606,7 @@ int performRtspHandshake(void) {
|
||||
sprintf(rtspTargetUrl, "rtsp%s://%s:48010", useEnet ? "ru" : "", urlAddr);
|
||||
currentSeqNumber = 1;
|
||||
hasSessionId = false;
|
||||
controlStreamId = APP_VERSION_AT_LEAST(7, 1, 431) ? "streamid=control/9/0" : "streamid=control/1/0";
|
||||
|
||||
switch (AppVersionQuad[0]) {
|
||||
case 3:
|
||||
@ -808,7 +811,9 @@ int performRtspHandshake(void) {
|
||||
RTSP_MESSAGE response;
|
||||
int error = -1;
|
||||
|
||||
if (!setupStream(&response, "streamid=control/1/0", &error)) {
|
||||
if (!setupStream(&response,
|
||||
controlStreamId,
|
||||
&error)) {
|
||||
Limelog("RTSP SETUP streamid=control request failed: %d\n", error);
|
||||
ret = error;
|
||||
goto Exit;
|
||||
@ -844,6 +849,27 @@ int performRtspHandshake(void) {
|
||||
freeMessage(&response);
|
||||
}
|
||||
|
||||
// GFE 3.22 uses a single PLAY message
|
||||
if (APP_VERSION_AT_LEAST(7, 1, 431)) {
|
||||
RTSP_MESSAGE response;
|
||||
int error = -1;
|
||||
|
||||
if (!playStream(&response, "/", &error)) {
|
||||
Limelog("RTSP PLAY streamid=video request failed: %d\n", error);
|
||||
ret = error;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (response.message.response.statusCode != 200) {
|
||||
Limelog("RTSP PLAY failed: %d\n",
|
||||
response.message.response.statusCode);
|
||||
ret = response.message.response.statusCode;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
freeMessage(&response);
|
||||
}
|
||||
else {
|
||||
{
|
||||
RTSP_MESSAGE response;
|
||||
int error = -1;
|
||||
@ -883,6 +909,8 @@ int performRtspHandshake(void) {
|
||||
|
||||
freeMessage(&response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user