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
921553d7
Commit
921553d7
authored
Sep 20, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.16.x'
parents
27946a98
c476819c
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
119 additions
and
30 deletions
+119
-30
Makefile.am
Makefile.am
+1
-0
NEWS
NEWS
+5
-1
configure.ac
configure.ac
+15
-4
client_new.c
src/client_new.c
+5
-7
event_pipe.c
src/event_pipe.c
+2
-5
fd_util.c
src/fd_util.c
+10
-0
fd_util.h
src/fd_util.h
+12
-0
glib_socket.h
src/glib_socket.h
+40
-0
httpd_client.c
src/output/httpd_client.c
+2
-5
httpd_output_plugin.c
src/output/httpd_output_plugin.c
+2
-2
solaris_output_plugin.c
src/output/solaris_output_plugin.c
+19
-1
server_socket.c
src/server_socket.c
+3
-2
socket_util.c
src/socket_util.c
+3
-3
No files found.
Makefile.am
View file @
921553d7
...
...
@@ -246,6 +246,7 @@ src_mpd_SOURCES = \
$(OUTPUT_API_SRC)
$(OUTPUT_SRC)
\
$(MIXER_API_SRC)
$(MIXER_SRC)
\
$(FILTER_SRC)
\
src/glib_socket.h
\
src/notify.c
\
src/audio.c
\
src/audio_check.c
\
...
...
NEWS
View file @
921553d7
...
...
@@ -23,13 +23,17 @@ ver 0.17 (2011/??/??)
ver 0.16.5 (2010/??/??)
* configure.ac: disable assertions in the non-debugging build
* configure.ac
- disable assertions in the non-debugging build
- show solaris plugin result correctly
- add option --enable-solaris-output
* pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
* input:
- rewind: reduce heap usage
* decoder:
- ffmpeg: higher precision timestamps
- ffmpeg: don't require key frame for seeking
* WIN32: close sockets properly
ver 0.16.4 (2011/09/01)
...
...
configure.ac
View file @
921553d7
...
...
@@ -344,6 +344,11 @@ AC_ARG_ENABLE(sndfile,
[enable sndfile support]),,
enable_sndfile=auto)
AC_ARG_ENABLE(solaris_output,
AS_HELP_STRING([--enable-solaris-output],
[enables the Solaris /dev/audio output]),,
[enable_solaris_output=auto])
AC_ARG_ENABLE(sqlite,
AS_HELP_STRING([--enable-sqlite],
[enable support for the SQLite database]),,
...
...
@@ -1377,16 +1382,22 @@ fi
AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes)
dnl --------------------------------- Solaris ---------------------------------
case "$host_os" in
if test x$enable_solaris_output = xauto; then
case "$host_os" in
solaris*)
AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
enable_solaris_output=yes
;;
*)
enable_solaris_output=no
;;
esac
esac
fi
if test x$enable_solaris_output = xyes; then
AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support])
fi
AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes)
...
...
@@ -1573,7 +1584,7 @@ results(pulse, [PulseAudio])
results(mvp, [Media MVP])
results(shout, [SHOUTcast])
printf '\n\t'
results(solaris, [Solaris])
results(solaris
_output
, [Solaris])
results(winmm_output, [WinMM])
if
...
...
src/client_new.c
View file @
921553d7
...
...
@@ -19,9 +19,11 @@
#include "config.h"
#include "client_internal.h"
#include "fd_util.h"
#include "fifo_buffer.h"
#include "socket_util.h"
#include "permission.h"
#include "glib_socket.h"
#include <assert.h>
#include <sys/types.h>
...
...
@@ -69,7 +71,7 @@ client_new(struct player_control *player_control,
progname
,
hostaddr
);
g_free
(
hostaddr
);
close
(
fd
);
close
_socket
(
fd
);
return
;
}
...
...
@@ -79,18 +81,14 @@ client_new(struct player_control *player_control,
if
(
client_list_is_full
())
{
g_warning
(
"Max Connections Reached!"
);
close
(
fd
);
close
_socket
(
fd
);
return
;
}
client
=
g_new0
(
struct
client
,
1
);
client
->
player_control
=
player_control
;
#ifndef G_OS_WIN32
client
->
channel
=
g_io_channel_unix_new
(
fd
);
#else
client
->
channel
=
g_io_channel_win32_new_socket
(
fd
);
#endif
client
->
channel
=
g_io_channel_new_socket
(
fd
);
/* GLib is responsible for closing the file descriptor */
g_io_channel_set_close_on_unref
(
client
->
channel
,
true
);
/* NULL encoding means the stream is binary safe; the MPD
...
...
src/event_pipe.c
View file @
921553d7
...
...
@@ -21,6 +21,7 @@
#include "event_pipe.h"
#include "fd_util.h"
#include "mpd_error.h"
#include "glib_socket.h"
#include <stdbool.h>
#include <assert.h>
...
...
@@ -94,11 +95,7 @@ void event_pipe_init(void)
if
(
ret
<
0
)
MPD_ERROR
(
"Couldn't open pipe: %s"
,
strerror
(
errno
));
#ifndef G_OS_WIN32
channel
=
g_io_channel_unix_new
(
event_pipe
[
0
]);
#else
channel
=
g_io_channel_win32_new_fd
(
event_pipe
[
0
]);
#endif
channel
=
g_io_channel_new_socket
(
event_pipe
[
0
]);
g_io_channel_set_encoding
(
channel
,
NULL
,
NULL
);
g_io_channel_set_buffered
(
channel
,
false
);
...
...
src/fd_util.c
View file @
921553d7
...
...
@@ -327,3 +327,13 @@ inotify_init_cloexec(void)
}
#endif
int
close_socket
(
int
fd
)
{
#ifdef WIN32
return
closesocket
(
fd
);
#else
return
close
(
fd
);
#endif
}
src/fd_util.h
View file @
921553d7
...
...
@@ -36,6 +36,8 @@
#ifndef FD_UTIL_H
#define FD_UTIL_H
#include "check.h"
#include <stdbool.h>
#include <stddef.h>
...
...
@@ -127,6 +129,8 @@ recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags);
#endif
#ifdef HAVE_INOTIFY_INIT
/**
* Wrapper for inotify_init(), which sets the CLOEXEC flag (atomically
* if supported by the OS).
...
...
@@ -135,3 +139,11 @@ int
inotify_init_cloexec
(
void
);
#endif
/**
* Portable wrapper for close(); use closesocket() on WIN32/WinSock.
*/
int
close_socket
(
int
fd
);
#endif
src/glib_socket.h
0 → 100644
View file @
921553d7
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_GLIB_SOCKET_H
#define MPD_GLIB_SOCKET_H
#include <glib.h>
/**
* Portable wrapper for g_io_channel_unix_new() or
* g_io_channel_win32_new_socket().
*/
G_GNUC_MALLOC
static
inline
GIOChannel
*
g_io_channel_new_socket
(
int
fd
)
{
#ifdef G_OS_WIN32
return
g_io_channel_win32_new_socket
(
fd
);
#else
return
g_io_channel_unix_new
(
fd
);
#endif
}
#endif
src/output/httpd_client.c
View file @
921553d7
...
...
@@ -24,6 +24,7 @@
#include "page.h"
#include "icy_server.h"
#include "glib_compat.h"
#include "glib_socket.h"
#include <stdbool.h>
#include <assert.h>
...
...
@@ -459,11 +460,7 @@ httpd_client_new(struct httpd_output *httpd, int fd, bool metadata_supported)
client
->
httpd
=
httpd
;
#ifndef G_OS_WIN32
client
->
channel
=
g_io_channel_unix_new
(
fd
);
#else
client
->
channel
=
g_io_channel_win32_new_socket
(
fd
);
#endif
client
->
channel
=
g_io_channel_new_socket
(
fd
);
/* GLib is responsible for closing the file descriptor */
g_io_channel_set_close_on_unref
(
client
->
channel
,
true
);
...
...
src/output/httpd_output_plugin.c
View file @
921553d7
...
...
@@ -214,7 +214,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address,
g_warning
(
"libwrap refused connection (libwrap=%s) from %s"
,
progname
,
hostaddr
);
g_free
(
hostaddr
);
close
(
fd
);
close
_socket
(
fd
);
g_mutex_unlock
(
httpd
->
mutex
);
return
;
}
...
...
@@ -235,7 +235,7 @@ httpd_listen_in_event(int fd, const struct sockaddr *address,
httpd
->
clients_cnt
<
httpd
->
clients_max
))
httpd_client_add
(
httpd
,
fd
);
else
close
(
fd
);
close
_socket
(
fd
);
}
else
if
(
fd
<
0
&&
errno
!=
EINTR
)
{
g_warning
(
"accept() failed: %s"
,
g_strerror
(
errno
));
}
...
...
src/output/solaris_output_plugin.c
View file @
921553d7
...
...
@@ -24,7 +24,6 @@
#include <glib.h>
#include <sys/audio.h>
#include <sys/stropts.h>
#include <sys/types.h>
#include <sys/stat.h>
...
...
@@ -32,6 +31,25 @@
#include <fcntl.h>
#include <errno.h>
#ifdef __sun
#include <sys/audio.h>
#else
/* some fake declarations that allow build this plugin on systems
other than Solaris, just to see if it compiles */
#define AUDIO_GETINFO 0
#define AUDIO_SETINFO 0
#define AUDIO_ENCODING_LINEAR 0
struct
audio_info
{
struct
{
unsigned
sample_rate
,
channels
,
precision
,
encoding
;
}
play
;
};
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "solaris_output"
...
...
src/server_socket.c
View file @
921553d7
...
...
@@ -27,6 +27,7 @@
#include "socket_util.h"
#include "fd_util.h"
#include "glib_compat.h"
#include "glib_socket.h"
#include <sys/types.h>
#include <sys/stat.h>
...
...
@@ -227,7 +228,7 @@ server_socket_open(struct server_socket *ss, GError **error_r)
/* register in the GLib main loop */
GIOChannel
*
channel
=
g_io_channel_
unix_new
(
s
->
fd
);
GIOChannel
*
channel
=
g_io_channel_
new_socket
(
s
->
fd
);
s
->
source_id
=
g_io_add_watch
(
channel
,
G_IO_IN
,
server_socket_in_event
,
s
);
g_io_channel_unref
(
channel
);
...
...
@@ -261,7 +262,7 @@ server_socket_close(struct server_socket *ss)
continue
;
g_source_remove
(
s
->
source_id
);
close
(
s
->
fd
);
close
_socket
(
s
->
fd
);
s
->
fd
=
-
1
;
}
}
...
...
src/socket_util.c
View file @
921553d7
...
...
@@ -122,7 +122,7 @@ socket_bind_listen(int domain, int type, int protocol,
if
(
ret
<
0
)
{
g_set_error
(
error
,
listen_quark
(),
errno
,
"setsockopt() failed: %s"
,
g_strerror
(
errno
));
close
(
fd
);
close
_socket
(
fd
);
return
-
1
;
}
...
...
@@ -130,7 +130,7 @@ socket_bind_listen(int domain, int type, int protocol,
if
(
ret
<
0
)
{
g_set_error
(
error
,
listen_quark
(),
errno
,
"%s"
,
g_strerror
(
errno
));
close
(
fd
);
close
_socket
(
fd
);
return
-
1
;
}
...
...
@@ -138,7 +138,7 @@ socket_bind_listen(int domain, int type, int protocol,
if
(
ret
<
0
)
{
g_set_error
(
error
,
listen_quark
(),
errno
,
"listen() failed: %s"
,
g_strerror
(
errno
));
close
(
fd
);
close
_socket
(
fd
);
return
-
1
;
}
...
...
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