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
7fe07324
Commit
7fe07324
authored
Jan 11, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/SoundCloud: soundcloud_parse_json() throws exception
parent
8e29430f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
SoundCloudPlaylistPlugin.cxx
src/playlist/plugins/SoundCloudPlaylistPlugin.cxx
+3
-12
No files found.
src/playlist/plugins/SoundCloudPlaylistPlugin.cxx
View file @
7fe07324
...
...
@@ -221,12 +221,11 @@ static constexpr yajl_callbacks parse_callbacks = {
* Read JSON data and parse it using the given YAJL parser.
* @param url URL of the JSON data.
* @param handle YAJL parser handle.
* @return -1 on error, 0 on success.
*/
static
int
static
void
soundcloud_parse_json
(
const
char
*
url
,
Yajl
::
Handle
&
handle
,
Mutex
&
mutex
,
Cond
&
cond
)
try
{
{
auto
input_stream
=
InputStream
::
OpenReady
(
url
,
mutex
,
cond
);
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
...
...
@@ -245,11 +244,6 @@ try {
}
else
handle
.
Parse
(
buffer
,
nbytes
);
}
return
0
;
}
catch
(
const
std
::
exception
&
e
)
{
LogError
(
e
);
return
-
1
;
}
/**
...
...
@@ -302,10 +296,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
SoundCloudJsonData
data
;
Yajl
::
Handle
handle
(
&
parse_callbacks
,
nullptr
,
&
data
);
int
ret
=
soundcloud_parse_json
(
u
,
handle
,
mutex
,
cond
);
if
(
ret
==
-
1
)
return
nullptr
;
soundcloud_parse_json
(
u
,
handle
,
mutex
,
cond
);
data
.
songs
.
reverse
();
return
new
MemorySongEnumerator
(
std
::
move
(
data
.
songs
));
...
...
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