mirror of
https://github.com/mpv-player/mpv
synced 2024-09-05 02:48:21 +02:00
Access-controlled RTSP sessions can now be played, if the user uses the
"-user" and "-passwd" options. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9905 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
23e0f24f27
commit
208d38b876
@ -94,6 +94,8 @@ typedef struct RTPState {
|
||||
struct timeval firstSyncTime;
|
||||
};
|
||||
|
||||
extern "C" char* network_username;
|
||||
extern "C" char* network_password;
|
||||
int rtspStreamOverTCP = 0;
|
||||
|
||||
extern "C" void demux_open_rtp(demuxer_t* demuxer) {
|
||||
@ -124,7 +126,15 @@ extern "C" void demux_open_rtp(demuxer_t* demuxer) {
|
||||
break;
|
||||
}
|
||||
|
||||
// If we were given a user name (and optional password), then use them:
|
||||
if (network_username != NULL) {
|
||||
char const* password
|
||||
= network_password == NULL ? "" : network_password;
|
||||
sdpDescription
|
||||
= rtspClient->describeWithPassword(url, network_username, password);
|
||||
} else {
|
||||
sdpDescription = rtspClient->describeURL(url);
|
||||
}
|
||||
if (sdpDescription == NULL) {
|
||||
fprintf(stderr, "Failed to get a SDP description from URL \"%s\": %s\n",
|
||||
url, env->getResultMsg());
|
||||
@ -306,6 +316,7 @@ Boolean insertRTPData(demuxer_t* demuxer, demux_stream_t* ds,
|
||||
dp->len = dataLen;
|
||||
dp->pts = 0;
|
||||
bufferQueue->savePendingBuffer(dp);
|
||||
return True;
|
||||
}
|
||||
|
||||
static void teardownRTSPSession(RTPState* rtpState); // forward
|
||||
|
Loading…
Reference in New Issue
Block a user