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
281b8714
Commit
281b8714
authored
Mar 19, 2012
by
Robert Vollmert
Committed by
Max Kellermann
Mar 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/soundcloud: support libyajl2
[mk: backwars compatibility and autoconf check]
parent
d5be3cce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
Makefile.am
Makefile.am
+1
-0
configure.ac
configure.ac
+5
-3
soundcloud_playlist_plugin.c
src/playlist/soundcloud_playlist_plugin.c
+21
-5
No files found.
Makefile.am
View file @
281b8714
...
...
@@ -889,6 +889,7 @@ libplaylist_plugins_a_SOURCES = \
src/playlist/embcue_playlist_plugin.h
\
src/playlist_list.c
libplaylist_plugins_a_CPPFLAGS
=
$(AM_CPPFLAGS)
\
$(YAJL_CFLAGS)
\
$
(
patsubst
-I
%/FLAC,-I%,
$(FLAC_CFLAGS)
)
PLAYLIST_LIBS
=
\
...
...
configure.ac
View file @
281b8714
...
...
@@ -709,9 +709,11 @@ AM_CONDITIONAL(ENABLE_DESPOTIFY, test x$enable_despotify = xyes)
dnl --------------------------------- Soundcloud ------------------------------
if test x$enable_soundcloud != xno; then
AC_CHECK_LIB([yajl], [yajl_alloc],
[found_soundcloud=yes YAJL_LIBS=-lyajl],
[found_soundcloud=no])
PKG_CHECK_MODULES([YAJL], [yajl >= 2.0],
[found_soundcloud=yes],
AC_CHECK_LIB([yajl], [yajl_alloc],
[found_soundcloud=yes YAJL_CFLAGS=-DHAVE_YAJL1 YAJL_LIBS=-lyajl],
[found_soundcloud=no]))
fi
MPD_AUTO_RESULT([soundcloud], [soundcloud.com support], [libyajl not found])
if test x$enable_soundcloud = xyes; then
...
...
src/playlist/soundcloud_playlist_plugin.c
View file @
281b8714
...
...
@@ -110,7 +110,12 @@ struct parse_data {
GSList
*
songs
;
};
static
int
handle_integer
(
void
*
ctx
,
long
intval
)
static
int
handle_integer
(
void
*
ctx
,
long
#ifndef HAVE_YAJL1
long
#endif
intval
)
{
struct
parse_data
*
data
=
(
struct
parse_data
*
)
ctx
;
...
...
@@ -269,13 +274,20 @@ soundcloud_parse_json(const char *url, yajl_handle hand, GMutex* mutex, GCond* c
}
}
if
(
done
)
if
(
done
)
{
#ifdef HAVE_YAJL1
stat
=
yajl_parse_complete
(
hand
);
else
#else
stat
=
yajl_complete_parse
(
hand
);
#endif
}
else
stat
=
yajl_parse
(
hand
,
ubuffer
,
nbytes
);
if
(
stat
!=
yajl_status_ok
&&
stat
!=
yajl_status_insufficient_data
)
if
(
stat
!=
yajl_status_ok
#ifdef HAVE_YAJL1
&&
stat
!=
yajl_status_insufficient_data
#endif
)
{
unsigned
char
*
str
=
yajl_get_error
(
hand
,
1
,
ubuffer
,
nbytes
);
g_warning
(
"%s"
,
str
);
...
...
@@ -356,7 +368,11 @@ soundcloud_open_uri(const char *uri, GMutex *mutex, GCond *cond)
data
.
songs
=
NULL
;
data
.
title
=
NULL
;
data
.
stream_url
=
NULL
;
#ifdef HAVE_YAJL1
hand
=
yajl_alloc
(
&
parse_callbacks
,
NULL
,
NULL
,
(
void
*
)
&
data
);
#else
hand
=
yajl_alloc
(
&
parse_callbacks
,
NULL
,
(
void
*
)
&
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