# HG changeset patch # User rsf # Date 1050028501 0 # Node ID afbbf103a6626f1fafe82826802ca6b103e7f3b9 # Parent 7d70e56f317a5081ac8e545719120096e907fe67 Access-controlled RTSP sessions can now be played, if the user uses the "-user" and "-passwd" options. diff -r 7d70e56f317a -r afbbf103a662 libmpdemux/demux_rtp.cpp --- a/libmpdemux/demux_rtp.cpp Thu Apr 10 15:07:59 2003 +0000 +++ b/libmpdemux/demux_rtp.cpp Fri Apr 11 02:35:01 2003 +0000 @@ -94,6 +94,8 @@ 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 @@ break; } - sdpDescription = rtspClient->describeURL(url); + // 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 @@ dp->len = dataLen; dp->pts = 0; bufferQueue->savePendingBuffer(dp); + return True; } static void teardownRTSPSession(RTPState* rtpState); // forward