Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0a342122
Commit
0a342122
authored
Dec 06, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup.
parent
fde8b7fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
40 deletions
+44
-40
modules/demux/live555.cpp
modules/demux/live555.cpp
+44
-40
No files found.
modules/demux/live555.cpp
View file @
0a342122
...
...
@@ -219,6 +219,7 @@ static int Open ( vlc_object_t *p_this )
MediaSubsessionIterator
*
iter
=
NULL
;
MediaSubsession
*
sub
=
NULL
;
int
i
,
i_return
;
int
i_error
=
VLC_EGENERIC
;
if
(
p_demux
->
s
)
{
...
...
@@ -292,6 +293,12 @@ static int Open ( vlc_object_t *p_this )
int
i_sdp_max
=
1000
;
uint8_t
*
p_sdp
=
(
uint8_t
*
)
malloc
(
i_sdp_max
);
if
(
!
p_sdp
)
{
i_error
=
VLC_ENOMEM
;
goto
error
;
}
for
(
;;
)
{
int
i_read
=
stream_Read
(
p_demux
->
s
,
&
p_sdp
[
i_sdp
],
...
...
@@ -332,6 +339,7 @@ static int Open ( vlc_object_t *p_this )
if
(
p_sys
->
p_sdp
==
NULL
)
{
msg_Err
(
p_demux
,
"Failed to retrieve the RTSP Session Description"
);
i_error
=
VLC_ENOMEM
;
goto
error
;
}
...
...
@@ -388,7 +396,7 @@ error:
vlc_UrlClean
(
&
p_sys
->
url
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
i_error
;
}
/*****************************************************************************
...
...
@@ -447,6 +455,25 @@ static int Connect( demux_t *p_demux )
int
i_http_port
=
0
;
int
i_ret
=
VLC_SUCCESS
;
psz_url
=
(
char
*
)
malloc
(
strlen
(
p_sys
->
psz_path
)
+
8
);
if
(
!
psz_url
)
return
VLC_ENOMEM
;
if
(
p_sys
->
url
.
psz_username
||
p_sys
->
url
.
psz_password
)
{
sprintf
(
psz_url
,
"rtsp://%s%s"
,
p_sys
->
url
.
psz_host
,
p_sys
->
url
.
psz_path
);
psz_user
=
strdup
(
p_sys
->
url
.
psz_username
);
psz_pwd
=
strdup
(
p_sys
->
url
.
psz_password
);
}
else
{
sprintf
(
psz_url
,
"rtsp://%s"
,
p_sys
->
psz_path
);
psz_user
=
var_CreateGetString
(
p_demux
,
"rtsp-user"
);
psz_pwd
=
var_CreateGetString
(
p_demux
,
"rtsp-pwd"
);
}
createnew:
if
(
var_CreateGetBool
(
p_demux
,
"rtsp-http"
)
)
i_http_port
=
var_CreateGetInteger
(
p_demux
,
"rtsp-http-port"
);
...
...
@@ -474,28 +501,7 @@ createnew:
#endif
}
psz_url
=
(
char
*
)
malloc
(
strlen
(
p_sys
->
psz_path
)
+
8
);
if
(
!
psz_url
)
return
VLC_ENOMEM
;
if
(
p_sys
->
url
.
psz_username
||
p_sys
->
url
.
psz_password
)
{
sprintf
(
psz_url
,
"rtsp://%s%s"
,
p_sys
->
url
.
psz_host
,
p_sys
->
url
.
psz_path
);
psz_user
=
strdup
(
p_sys
->
url
.
psz_username
);
psz_pwd
=
strdup
(
p_sys
->
url
.
psz_password
);
}
else
{
sprintf
(
psz_url
,
"rtsp://%s"
,
p_sys
->
psz_path
);
psz_user
=
var_CreateGetString
(
p_demux
,
"rtsp-user"
);
psz_pwd
=
var_CreateGetString
(
p_demux
,
"rtsp-pwd"
);
}
describe:
msg_Info
(
p_demux
,
"[%s] user=%s pwd=%s"
,
psz_url
,
psz_user
,
psz_pwd
);
authenticator
.
setUsernameAndPassword
(
(
const
char
*
)
psz_user
,
(
const
char
*
)
psz_pwd
);
...
...
@@ -503,12 +509,8 @@ msg_Info( p_demux, "[%s] user=%s pwd=%s", psz_url, psz_user, psz_pwd );
&
authenticator
);
if
(
psz_options
)
delete
[]
psz_options
;
p_sdp
=
p_sys
->
rtsp
->
describeURL
(
psz_url
,
&
authenticator
,
var_CreateGetBool
(
p_demux
,
"rtsp-kasenna"
)
);
if
(
psz_user
)
free
(
psz_user
);
if
(
psz_pwd
)
free
(
psz_pwd
);
p_sdp
=
p_sys
->
rtsp
->
describeURL
(
psz_url
,
&
authenticator
,
var_CreateGetBool
(
p_demux
,
"rtsp-kasenna"
)
);
if
(
p_sdp
==
NULL
)
{
/* failure occurred */
...
...
@@ -517,28 +519,28 @@ msg_Info( p_demux, "[%s] user=%s pwd=%s", psz_url, psz_user, psz_pwd );
msg_Dbg
(
p_demux
,
"DESCRIBE failed with %d: %s"
,
i_code
,
psz_error
);
if
(
var_CreateGetBool
(
p_demux
,
"rtsp-http"
)
)
sscanf
(
psz_error
,
"%*s %*s HTTP GET %*s HTTP/%*u.%*u %3u %*s"
,
&
i_code
);
sscanf
(
psz_error
,
"%*s %*s HTTP GET %*s HTTP/%*u.%*u %3u %*s"
,
&
i_code
);
else
sscanf
(
psz_error
,
"%*sRTSP/%*s%3u"
,
&
i_code
);
if
(
i_code
==
401
)
{
char
*
psz_login
=
NULL
;
char
*
psz_password
=
NULL
;
int
i_result
;
msg_Dbg
(
p_demux
,
"authentication failed"
);
i_ret
=
intf_UserLoginPassword
(
p_demux
,
_
(
"RTSP authentication"
),
if
(
psz_user
)
free
(
psz_user
);
if
(
psz_pwd
)
free
(
psz_pwd
);
psz_user
=
psz_pwd
=
NULL
;
i_result
=
intf_UserLoginPassword
(
p_demux
,
_
(
"RTSP authentication"
),
_
(
"Please enter a valid login name and a password."
),
&
psz_
login
,
&
psz_passwor
d
);
if
(
i_ret
==
DIALOG_OK_YES
)
&
psz_
user
,
&
psz_pw
d
);
if
(
i_re
sul
t
==
DIALOG_OK_YES
)
{
msg_Dbg
(
p_demux
,
"retrying with user=%s, pwd=%s"
,
psz_login
,
psz_password
);
if
(
psz_login
)
psz_user
=
psz_login
;
if
(
psz_password
)
psz_pwd
=
psz_password
;
i_ret
=
VLC_SUCCESS
;
psz_user
,
psz_pwd
);
goto
describe
;
}
if
(
psz_login
)
free
(
psz_login
);
if
(
psz_password
)
free
(
psz_password
);
}
else
if
(
!
var_GetBool
(
p_demux
,
"rtsp-http"
)
)
{
...
...
@@ -547,7 +549,6 @@ msg_Info( p_demux, "[%s] user=%s pwd=%s", psz_url, psz_user, psz_pwd );
val
.
b_bool
=
VLC_TRUE
;
msg_Dbg
(
p_demux
,
"we will now try HTTP tunneling mode"
);
var_Set
(
p_demux
,
"rtsp-http"
,
val
);
if
(
psz_url
)
free
(
psz_url
);
if
(
p_sys
->
rtsp
)
RTSPClient
::
close
(
p_sys
->
rtsp
);
goto
createnew
;
}
...
...
@@ -556,6 +557,9 @@ msg_Info( p_demux, "[%s] user=%s pwd=%s", psz_url, psz_user, psz_pwd );
if
(
psz_url
)
free
(
psz_url
);
/* malloc-ated copy */
if
(
psz_user
)
free
(
psz_user
);
if
(
psz_pwd
)
free
(
psz_pwd
);
if
(
p_sys
->
p_sdp
)
free
(
p_sys
->
p_sdp
);
p_sys
->
p_sdp
=
NULL
;
if
(
p_sdp
)
p_sys
->
p_sdp
=
strdup
(
(
char
*
)
p_sdp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment