Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
642f48df
Commit
642f48df
authored
Nov 26, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioscrobbler: use psz_md5_hash()
parent
4720279d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
+11
-18
No files found.
modules/misc/audioscrobbler.c
View file @
642f48df
...
@@ -694,7 +694,6 @@ static int Handshake( intf_thread_t *p_this )
...
@@ -694,7 +694,6 @@ static int Handshake( intf_thread_t *p_this )
char
psz_timestamp
[
33
];
char
psz_timestamp
[
33
];
struct
md5_s
p_struct_md5
;
struct
md5_s
p_struct_md5
;
char
psz_password_md5
[
33
];
stream_t
*
p_stream
;
stream_t
*
p_stream
;
char
*
psz_handshake_url
;
char
*
psz_handshake_url
;
...
@@ -735,15 +734,11 @@ static int Handshake( intf_thread_t *p_this )
...
@@ -735,15 +734,11 @@ static int Handshake( intf_thread_t *p_this )
free
(
psz_password
);
free
(
psz_password
);
int
i
;
char
*
psz_password_md5
=
psz_md5_hash
(
&
p_struct_md5
)
;
for
(
i
=
0
;
i
<
4
;
i
++
)
if
(
!
psz_password_md5
)
{
{
sprintf
(
&
psz_password_md5
[
8
*
i
],
"%02x%02x%02x%02x"
,
free
(
psz_username
);
p_struct_md5
.
p_digest
[
i
]
&
0xff
,
return
VLC_ENOMEM
;
(
p_struct_md5
.
p_digest
[
i
]
>>
8
)
&
0xff
,
(
p_struct_md5
.
p_digest
[
i
]
>>
16
)
&
0xff
,
p_struct_md5
.
p_digest
[
i
]
>>
24
);
}
}
snprintf
(
psz_timestamp
,
33
,
"%llu"
,
(
uintmax_t
)
timestamp
);
snprintf
(
psz_timestamp
,
33
,
"%llu"
,
(
uintmax_t
)
timestamp
);
...
@@ -756,18 +751,16 @@ static int Handshake( intf_thread_t *p_this )
...
@@ -756,18 +751,16 @@ static int Handshake( intf_thread_t *p_this )
AddMD5
(
&
p_struct_md5
,
(
uint8_t
*
)
psz_password_md5
,
32
);
AddMD5
(
&
p_struct_md5
,
(
uint8_t
*
)
psz_password_md5
,
32
);
AddMD5
(
&
p_struct_md5
,
(
uint8_t
*
)
psz_timestamp
,
strlen
(
psz_timestamp
));
AddMD5
(
&
p_struct_md5
,
(
uint8_t
*
)
psz_timestamp
,
strlen
(
psz_timestamp
));
EndMD5
(
&
p_struct_md5
);
EndMD5
(
&
p_struct_md5
);
free
(
psz_password_md5
);
for
(
i
=
0
;
i
<
4
;
i
++
)
char
*
psz_auth_token
=
psz_md5_hash
(
&
p_struct_md5
);
if
(
!
psz_auth_token
)
{
{
sprintf
(
&
p_sys
->
psz_auth_token
[
8
*
i
],
"%02x%02x%02x%02x"
,
free
(
psz_username
);
p_struct_md5
.
p_digest
[
i
]
&
0xff
,
return
VLC_ENOMEM
;
(
p_struct_md5
.
p_digest
[
i
]
>>
8
)
&
0xff
,
(
p_struct_md5
.
p_digest
[
i
]
>>
16
)
&
0xff
,
p_struct_md5
.
p_digest
[
i
]
>>
24
);
}
}
strncpy
(
&
p_sys
->
psz_auth_token
[
0
],
psz_auth_token
,
33
);
p_sys
->
psz_auth_token
[
32
]
=
'\0'
;
free
(
psz_auth_token
)
;
if
(
!
asprintf
(
&
psz_handshake_url
,
if
(
!
asprintf
(
&
psz_handshake_url
,
"http://post.audioscrobbler.com/?hs=true&p=1.2&c=%s&v=%s&u=%s&t=%s&a=%s"
,
"http://post.audioscrobbler.com/?hs=true&p=1.2&c=%s&v=%s&u=%s&t=%s&a=%s"
,
...
...
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