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
533699ab
Commit
533699ab
authored
Dec 14, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/soundcloud: drop support for libyajl1
Require the version 2 which has a more sane API.
parent
267ccc98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
39 deletions
+5
-39
configure.ac
configure.ac
+1
-4
SoundCloudPlaylistPlugin.cxx
src/playlist/plugins/SoundCloudPlaylistPlugin.cxx
+4
-35
No files found.
configure.ac
View file @
533699ab
...
...
@@ -770,14 +770,11 @@ dnl --------------------------------- Soundcloud ------------------------------
MPD_AUTO([soundcloud], [soundcloud.com support], [libyajl not found],
[PKG_CHECK_MODULES([YAJL], [yajl >= 2.0],
[found_soundcloud=yes],
AC_CHECK_LIB([yajl], [yajl_parse_complete],
[found_soundcloud=yes YAJL_CFLAGS=-DHAVE_YAJL1 YAJL_LIBS=-lyajl],
[found_soundcloud=no]))])
[found_soundcloud=no])])
if test x$enable_soundcloud = xyes; then
AC_DEFINE(ENABLE_SOUNDCLOUD, 1, [Define when soundcloud is enabled])
fi
AM_CONDITIONAL(ENABLE_SOUNDCLOUD, test x$enable_soundcloud = xyes)
AC_SUBST(YAJL_LIBS)
dnl ---------------------------------- cdio ---------------------------------
MPD_ENABLE_AUTO_PKG(cdio_paranoia, CDIO_PARANOIA, [libcdio_paranoia],
...
...
src/playlist/plugins/SoundCloudPlaylistPlugin.cxx
View file @
533699ab
...
...
@@ -112,12 +112,7 @@ struct parse_data {
};
static
int
handle_integer
(
void
*
ctx
,
long
#ifndef HAVE_YAJL1
long
#endif
intval
)
handle_integer
(
void
*
ctx
,
long
long
intval
)
{
struct
parse_data
*
data
=
(
struct
parse_data
*
)
ctx
;
...
...
@@ -133,13 +128,7 @@ handle_integer(void *ctx,
}
static
int
handle_string
(
void
*
ctx
,
const
unsigned
char
*
stringval
,
#ifdef HAVE_YAJL1
unsigned
int
#else
size_t
#endif
stringlen
)
handle_string
(
void
*
ctx
,
const
unsigned
char
*
stringval
,
size_t
stringlen
)
{
struct
parse_data
*
data
=
(
struct
parse_data
*
)
ctx
;
const
char
*
s
=
(
const
char
*
)
stringval
;
...
...
@@ -162,13 +151,7 @@ handle_string(void *ctx, const unsigned char* stringval,
}
static
int
handle_mapkey
(
void
*
ctx
,
const
unsigned
char
*
stringval
,
#ifdef HAVE_YAJL1
unsigned
int
#else
size_t
#endif
stringlen
)
handle_mapkey
(
void
*
ctx
,
const
unsigned
char
*
stringval
,
size_t
stringlen
)
{
struct
parse_data
*
data
=
(
struct
parse_data
*
)
ctx
;
...
...
@@ -283,20 +266,11 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
}
if
(
done
)
{
#ifdef HAVE_YAJL1
stat
=
yajl_parse_complete
(
hand
);
#else
stat
=
yajl_complete_parse
(
hand
);
#endif
}
else
stat
=
yajl_parse
(
hand
,
ubuffer
,
nbytes
);
if
(
stat
!=
yajl_status_ok
#ifdef HAVE_YAJL1
&&
stat
!=
yajl_status_insufficient_data
#endif
)
{
if
(
stat
!=
yajl_status_ok
)
{
unsigned
char
*
str
=
yajl_get_error
(
hand
,
1
,
ubuffer
,
nbytes
);
LogError
(
soundcloud_domain
,
(
const
char
*
)
str
);
yajl_free_error
(
hand
,
str
);
...
...
@@ -360,12 +334,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
data
.
got_url
=
0
;
data
.
title
=
nullptr
;
data
.
stream_url
=
nullptr
;
#ifdef HAVE_YAJL1
yajl_handle
hand
=
yajl_alloc
(
&
parse_callbacks
,
nullptr
,
nullptr
,
&
data
);
#else
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