Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
73d917b7
Commit
73d917b7
authored
Dec 14, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/soundcloud: make variables more local
parent
527a6003
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
SoundCloudPlaylistPlugin.cxx
src/playlist/SoundCloudPlaylistPlugin.cxx
+17
-21
No files found.
src/playlist/SoundCloudPlaylistPlugin.cxx
View file @
73d917b7
...
...
@@ -207,12 +207,9 @@ static int handle_end_map(void *ctx)
/* got_url == 1, track finished, make it into a song */
data
->
got_url
=
0
;
Song
*
s
;
char
*
u
;
u
=
g_strconcat
(
data
->
stream_url
,
"?client_id="
,
soundcloud_config
.
apikey
.
c_str
(),
nullptr
);
s
=
Song
::
NewRemote
(
u
);
char
*
u
=
g_strconcat
(
data
->
stream_url
,
"?client_id="
,
soundcloud_config
.
apikey
.
c_str
(),
nullptr
);
Song
*
s
=
Song
::
NewRemote
(
u
);
g_free
(
u
);
TagBuilder
tag
;
...
...
@@ -250,9 +247,6 @@ static int
soundcloud_parse_json
(
const
char
*
url
,
yajl_handle
hand
,
Mutex
&
mutex
,
Cond
&
cond
)
{
char
buffer
[
4096
];
unsigned
char
*
ubuffer
=
(
unsigned
char
*
)
buffer
;
Error
error
;
InputStream
*
input_stream
=
InputStream
::
Open
(
url
,
mutex
,
cond
,
error
);
...
...
@@ -269,6 +263,8 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
int
done
=
0
;
while
(
!
done
)
{
char
buffer
[
4096
];
unsigned
char
*
ubuffer
=
(
unsigned
char
*
)
buffer
;
const
size_t
nbytes
=
input_stream
->
Read
(
buffer
,
sizeof
(
buffer
),
error
);
if
(
nbytes
==
0
)
{
...
...
@@ -319,22 +315,22 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
* soundcloud://playlist/<playlist-id>
* soundcloud://url/<url or path of soundcloud page>
*/
static
SongEnumerator
*
soundcloud_open_uri
(
const
char
*
uri
,
Mutex
&
mutex
,
Cond
&
cond
)
{
char
*
s
,
*
p
;
char
*
scheme
,
*
arg
,
*
rest
;
s
=
g_strdup
(
uri
);
scheme
=
s
;
for
(
p
=
s
;
*
p
;
p
++
)
{
char
*
s
=
g_strdup
(
uri
)
;
char
*
scheme
=
s
;
char
*
p
=
s
;
for
(;
*
p
;
p
++
)
{
if
(
*
p
==
':'
&&
*
(
p
+
1
)
==
'/'
&&
*
(
p
+
2
)
==
'/'
)
{
*
p
=
0
;
p
+=
3
;
break
;
}
}
arg
=
p
;
char
*
arg
=
p
;
for
(;
*
p
;
p
++
)
{
if
(
*
p
==
'/'
)
{
*
p
=
0
;
...
...
@@ -342,7 +338,8 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
break
;
}
}
rest
=
p
;
char
*
rest
=
p
;
if
(
strcmp
(
scheme
,
"soundcloud"
)
!=
0
)
{
FormatWarning
(
soundcloud_domain
,
...
...
@@ -373,16 +370,15 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
return
nullptr
;
}
yajl_handle
hand
;
struct
parse_data
data
;
data
.
got_url
=
0
;
data
.
title
=
nullptr
;
data
.
stream_url
=
nullptr
;
#ifdef HAVE_YAJL1
hand
=
yajl_alloc
(
&
parse_callbacks
,
nullptr
,
nullptr
,
(
void
*
)
&
data
);
yajl_handle
hand
=
yajl_alloc
(
&
parse_callbacks
,
nullptr
,
nullptr
,
&
data
);
#else
hand
=
yajl_alloc
(
&
parse_callbacks
,
nullptr
,
(
void
*
)
&
data
);
yajl_handle
hand
=
yajl_alloc
(
&
parse_callbacks
,
nullptr
,
&
data
);
#endif
int
ret
=
soundcloud_parse_json
(
u
,
hand
,
mutex
,
cond
);
...
...
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