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
c5d0a4ec
Commit
c5d0a4ec
authored
Jan 05, 2016
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
live555: use vlc_credential
parent
be947a40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
modules/access/live555.cpp
modules/access/live555.cpp
+21
-15
No files found.
modules/access/live555.cpp
View file @
c5d0a4ec
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <vlc_url.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_strings.h>
#include <vlc_interrupt.h>
#include <vlc_interrupt.h>
#include <vlc_keystore.h>
#include <limits.h>
#include <limits.h>
#include <assert.h>
#include <assert.h>
...
@@ -557,8 +558,9 @@ static int Connect( demux_t *p_demux )
...
@@ -557,8 +558,9 @@ static int Connect( demux_t *p_demux )
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
Authenticator
authenticator
;
Authenticator
authenticator
;
char
*
psz_user
=
NULL
;
vlc_credential
credential
;
char
*
psz_pwd
=
NULL
;
const
char
*
psz_user
=
NULL
;
const
char
*
psz_pwd
=
NULL
;
char
*
psz_url
=
NULL
;
char
*
psz_url
=
NULL
;
int
i_http_port
=
0
;
int
i_http_port
=
0
;
int
i_ret
=
VLC_SUCCESS
;
int
i_ret
=
VLC_SUCCESS
;
...
@@ -577,17 +579,21 @@ static int Connect( demux_t *p_demux )
...
@@ -577,17 +579,21 @@ static int Connect( demux_t *p_demux )
p_sys
->
url
.
psz_option
?
"?"
:
""
,
p_sys
->
url
.
psz_option
?
"?"
:
""
,
strempty
(
p_sys
->
url
.
psz_option
)
)
==
-
1
)
strempty
(
p_sys
->
url
.
psz_option
)
)
==
-
1
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
psz_user
=
strdup
(
strempty
(
p_sys
->
url
.
psz_username
)
);
psz_pwd
=
strdup
(
strempty
(
p_sys
->
url
.
psz_password
)
);
}
}
else
else
{
{
if
(
asprintf
(
&
psz_url
,
"rtsp://%s"
,
p_sys
->
psz_path
)
==
-
1
)
if
(
asprintf
(
&
psz_url
,
"rtsp://%s"
,
p_sys
->
psz_path
)
==
-
1
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
vlc_credential_init
(
&
credential
,
&
p_sys
->
url
);
psz_user
=
var_InheritString
(
p_demux
,
"rtsp-user"
);
/* Credentials can be NULL since they may not be needed */
psz_pwd
=
var_InheritString
(
p_demux
,
"rtsp-pwd"
);
if
(
vlc_credential_get
(
&
credential
,
p_demux
,
"rtsp-user"
,
"rtsp-pwd"
,
NULL
,
NULL
)
)
{
psz_user
=
credential
.
psz_username
;
psz_pwd
=
credential
.
psz_password
;
}
}
createnew:
createnew:
...
@@ -637,13 +643,12 @@ describe:
...
@@ -637,13 +643,12 @@ describe:
{
{
msg_Dbg
(
p_demux
,
"authentication failed"
);
msg_Dbg
(
p_demux
,
"authentication failed"
);
free
(
psz_user
);
if
(
vlc_credential_get
(
&
credential
,
p_demux
,
"rtsp-user"
,
"rtsp-pwd"
,
free
(
psz_pwd
);
_
(
"RTSP authentication"
),
dialog_Login
(
p_demux
,
&
psz_user
,
&
psz_pwd
,
_
(
"Please enter a valid login name and a password."
)
)
)
_
(
"RTSP authentication"
),
"%s"
,
_
(
"Please enter a valid login name and a password."
)
);
if
(
psz_user
!=
NULL
&&
psz_pwd
!=
NULL
)
{
{
psz_user
=
credential
.
psz_username
;
psz_pwd
=
credential
.
psz_password
;
msg_Dbg
(
p_demux
,
"retrying with user=%s"
,
psz_user
);
msg_Dbg
(
p_demux
,
"retrying with user=%s"
,
psz_user
);
goto
describe
;
goto
describe
;
}
}
...
@@ -673,12 +678,13 @@ describe:
...
@@ -673,12 +678,13 @@ describe:
}
}
i_ret
=
VLC_EGENERIC
;
i_ret
=
VLC_EGENERIC
;
}
}
else
vlc_credential_store
(
&
credential
);
bailout:
bailout:
/* malloc-ated copy */
/* malloc-ated copy */
free
(
psz_url
);
free
(
psz_url
);
free
(
psz_user
);
vlc_credential_clean
(
&
credential
);
free
(
psz_pwd
);
return
i_ret
;
return
i_ret
;
}
}
...
...
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