Re: [Musicpd-dev-team] [PATCH] decoder/vorbis: avoid unused symbol warnings from vorbisfile.h

2009-10-18 Thread Serge Ziryukin
On Sun, Oct 18, 2009 at 04:03PM +0200, Max Kellermann wrote:
 On 2009/10/18 14:24, Serge Ziryukin ftrvxm...@gmail.com wrote:
  ---
   src/decoder/vorbis_plugin.c |1 +
   1 files changed, 1 insertions(+), 0 deletions(-)
  
  diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c
  index 95f2de0..2ac9c3b 100755
  --- a/src/decoder/vorbis_plugin.c
  +++ b/src/decoder/vorbis_plugin.c
  @@ -24,6 +24,7 @@
   #include uri.h
   
   #ifndef HAVE_TREMOR
  +#define OV_EXCLUDE_STATIC_CALLBACKS
   #include vorbis/vorbisfile.h
   #else
   #include tremor/ivorbisfile.h
 
 I don't see a warning with Debian version 1.0.2+svn14261-1.  Please
 add some more description to that patch, write which version of tremor
 is affected (paste the warning message), and where we can find
 documentation on that macro.

Compiling with libvorbis-1.2.3 installed gives me these warnings:
 gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -I./src -D_REENTRANT 
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include  
-DSYSTEM_CONFIG_FILE_LOCATION='/usr/local/etc/mpd.conf'  -I/usr/local/include 
 -I/usr/local/include  -I/usr/local/include/ -I/usr/local/include/glib-2.0 
-I/usr/local/lib/glib-2.0/include-I/usr/local/include   
-I/usr/local/include  -I/usr/local/include -D_REENTRANT  -I/usr/local/include 
-I/usr/local/include/libmodplug-I/usr/local/include  
-I/usr/local/include  -I/usr/local/include  -I/usr/local/include 
-I/usr/local/include/ffmpeg  -I/usr/local/include/libcue-1.3
-I/usr/local/include  -I/usr/local/include  -I/usr/local/include  
-I/usr/local/include-I/usr/local/include  -D_REENTRANT -I/usr/local/include 
 -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/speex 
-I/usr/local/include -I/usr/local/include/ffmpeg -Wall -Wextra 
-Wno-deprecated-declarations -Wmissing-prototypes -Wdeclaration-after-statement 
-Wshadow -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wwrite-strings 
-pedantic -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include 
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   
-I/usr/local/include -g -O2 -I/usr/local/include -MT src_mpd-vorbis_plugin.o 
-MD -MP -MF .deps/src_mpd-vorbis_plugin.Tpo -c -o src_mpd-vorbis_plugin.o `test 
-f 'src/decoder/vorbis_plugin.c' || echo './'`src/decoder/vorbis_plugin.c
/usr/local/include/vorbis/vorbisfile.h:75: warning: 'OV_CALLBACKS_DEFAULT' 
defined but not used
/usr/local/include/vorbis/vorbisfile.h:82: warning: 'OV_CALLBACKS_NOCLOSE' 
defined but not used
/usr/local/include/vorbis/vorbisfile.h:89: warning: 'OV_CALLBACKS_STREAMONLY' 
defined but not used
/usr/local/include/vorbis/vorbisfile.h:96: warning: 
'OV_CALLBACKS_STREAMONLY_NOCLOSE' defined but not used

libtremor does not have such callbacks.

svn r13289 of libvorbis introduced static callbacks (like OV_CALLBACKS_DEFAULT)
defined in vorbisfile.h header. First released version with this change is 
libvorbis-1.2.2.
In libversion-1.2.3 OV_EXCLUDE_STATIC_CALLBACKS define was added to avoid
warnings about unused static callbacks. Information on the 
OV_EXCLUDE_STATIC_CALLBACKS
can be found in http://svn.xiph.org/trunk/vorbis/CHANGES.

More verbose patch attached.
From fbb42d5c39a62d9f8e428af80ac0d0907b1b685f Mon Sep 17 00:00:00 2001
From: Serge Ziryukin ftrvxm...@gmail.com
Date: Sun, 18 Oct 2009 18:09:32 +0300
Subject: [PATCH] decoder/vorbis: avoid unused symbol warnings from vorbisfile.h

svn r13289 of libvorbis introduced static callbacks (like OV_CALLBACKS_DEFAULT)
defined in vorbisfile.h header. First released version with this change is libvorbis-1.2.2.
In libversion-1.2.3 OV_EXCLUDE_STATIC_CALLBACKS define was added to avoid
warnings about unused static callbacks. Information on the OV_EXCLUDE_STATIC_CALLBACKS
can be found in http://svn.xiph.org/trunk/vorbis/CHANGES.
---
 src/decoder/vorbis_plugin.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c
index 95f2de0..2ac9c3b 100755
--- a/src/decoder/vorbis_plugin.c
+++ b/src/decoder/vorbis_plugin.c
@@ -24,6 +24,7 @@
 #include uri.h
 
 #ifndef HAVE_TREMOR
+#define OV_EXCLUDE_STATIC_CALLBACKS
 #include vorbis/vorbisfile.h
 #else
 #include tremor/ivorbisfile.h
-- 
1.6.4.3



pgpxAyOREfX7e.pgp
Description: PGP signature
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH] input/mms: fix G_LOG_DOMAIN value

2009-09-20 Thread Serge Ziryukin
---
 src/input/mms_input_plugin.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/input/mms_input_plugin.c b/src/input/mms_input_plugin.c
index 82162a5..2a3c537 100644
--- a/src/input/mms_input_plugin.c
+++ b/src/input/mms_input_plugin.c
@@ -27,7 +27,7 @@
 #include errno.h
 
 #undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN jack
+#define G_LOG_DOMAIN input_mms
 
 struct input_mms {
mmsx_t *mms;
-- 
1.6.4.3



pgpnzFS8ntFnm.pgp
Description: PGP signature
--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH] output/openal: support OpenAL plugin on Mac OS X

2009-09-07 Thread Serge Ziryukin
---
 configure.ac   |   16 +---
 src/output/openal_plugin.c |6 ++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index d30e892..e221855 100644
--- a/configure.ac
+++ b/configure.ac
@@ -791,9 +791,19 @@ fi
 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
 
 if test x$enable_openal = xyes; then
-   PKG_CHECK_MODULES([OPENAL], [openal],
-   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
-   enable_openal=no)
+   if test x$enable_osx = xyes; then
+   AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h], [], 
[enable_openal=no])
+   if test x$enable_openal = xyes; then
+   OPENAL_LIBS=-framework OpenAL
+   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support])
+   else
+   AC_MSG_WARN(OpenAL headers not found -- disabling 
OpenAL support)
+   fi
+   else
+   PKG_CHECK_MODULES([OPENAL], [openal],
+   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
+   enable_openal=no)
+   fi
 fi
 
 if test x$enable_openal = xyes; then
diff --git a/src/output/openal_plugin.c b/src/output/openal_plugin.c
index e60e378..92ee82e 100644
--- a/src/output/openal_plugin.c
+++ b/src/output/openal_plugin.c
@@ -19,11 +19,17 @@
 
 #include ../output_api.h
 #include ../timer.h
+#include config.h
 
 #include glib.h
 
+#ifndef HAVE_OSX
 #include AL/al.h
 #include AL/alc.h
+#else
+#include OpenAL/al.h
+#include OpenAL/alc.h
+#endif
 
 #undef G_LOG_DOMAIN
 #define G_LOG_DOMAIN openal
-- 
1.6.3.2



pgpV2WLaT9NOm.pgp
Description: PGP signature
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


Re: [Musicpd-dev-team] [PATCH] output/openal: support OpenAL plugin on Mac OS X

2009-09-07 Thread Serge Ziryukin
On Mon, Sep 07, 2009 at 02:17PM +0200, Max Kellermann wrote:
 On 2009/09/07 14:01, Serge Ziryukin ftrvxm...@gmail.com wrote:
   if test x$enable_openal = xyes; then
  -   PKG_CHECK_MODULES([OPENAL], [openal],
  -   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
  -   enable_openal=no)
  +   if test x$enable_osx = xyes; then
  +   AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h], [], 
  [enable_openal=no])
  +   if test x$enable_openal = xyes; then
  +   OPENAL_LIBS=-framework OpenAL
  +   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support])
  +   else
  +   AC_MSG_WARN(OpenAL headers not found -- disabling 
  OpenAL support)
  +   fi
  +   else
  +   PKG_CHECK_MODULES([OPENAL], [openal],
  +   AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
  +   enable_openal=no)
  +   fi
 
 Does pkg-config not work?  If not, why does nobody fix the .pc file,
 instead of adding such a non-portable hack to every program which
 wants to use OpenAL?

pkg-config is MacPorts specific and there is no .pc file in OpenAL port 
installation:

 ftrvxmtrx:~ $ pkg-config --list-all | grep -i openal
 ftrvxmtrx:~ $ port contents openal
 Port openal contains:
   /opt/local/include/openal/al.h
   /opt/local/include/openal/alc.h
   /opt/local/include/openal/alctypes.h
   /opt/local/include/openal/altypes.h
   /opt/local/include/openal/alut.h
   /opt/local/lib/libopenal.dylib
   /opt/local/lib/libopenal1.0.0.dylib
   /opt/local/lib/libopenal1.0.dylib
   /opt/local/lib/libopenal1.dylib

Also, OpenAL may be already installed as a development framework,
without using MacPorts (patch is for this case).
Another solution could be fixing OpenAL port installation so it contains 
openal.pc file
and support only OpenAL installed from MacPorts.


pgp3bPhIfxXte.pgp
Description: PGP signature
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH 2/2] doc: documented the openal output plugin settings

2009-09-06 Thread Serge Ziryukin
---
 NEWS |1 +
 doc/user.xml |   33 +
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index e311d94..aa637d5 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ ver 0.16 (20??/??/??)
   - twolame: new encoder plugin based on libtwolame
 * output:
   - recorder: new output plugin for recording radio streams
+  - openal: new output plugin
 * mixers:
   - removed support for legacy mixer configuration
   - reimplemented software volume as mixer+filter plugin
diff --git a/doc/user.xml b/doc/user.xml
index 8534170..359e17a 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -753,6 +753,39 @@ cd mpd-version/programlisting
   /section
 
   section
+titlevarnameopenal/varname/title
+
+para
+  The OpenAL plugin uses filenamelibopenal/filename.
+  It is supported on many platforms.
+/para
+
+informaltable
+  tgroup cols=2
+thead
+  row
+entrySetting/entry
+entryDescription/entry
+  /row
+/thead
+tbody
+  row
+entry
+  varnamedevice/varname
+  parameterNAME/parameter
+/entry
+entry
+  Sets the device which should be used.  This can be
+  any valid OpenAL device name. If not specified, then
+  filenamelibopenal/filename will choose a default device.
+/entry
+  /row
+/tbody
+  /tgroup
+/informaltable
+  /section
+
+  section
 titlevarnameosx/varname/title
 
 para
-- 
1.6.3.2



pgpHZc07WAf2R.pgp
Description: PGP signature
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


Re: [Musicpd-dev-team] [PATCH] OpenAL output plugin

2009-08-31 Thread Serge Ziryukin
Hi.

On Sun, Aug 30, 2009 at 06:56PM +0200, Max Kellermann wrote:
 Hi Serge,
 
 thanks for your contribution.  I have two questions about your patch:
 
 On 2009/08/30 16:51, Serge Ziryukin ftrvxm...@gmail.com wrote:
  OpenAL output plugin
  
  +static void *
  +openal_init(G_GNUC_UNUSED const struct audio_format *audio_format,
  +   const struct config_param *param,
  +   GError **error)
  +{
  +   const char *device_name = config_get_block_string(param, device, 
  NULL);
  +   ALCdevice *device = alcOpenDevice(device_name);
 
 Why does it open the device in the init() method?  This way, MPD
 cannot start while another program locks the sound card.  Do that in
 open().
 

OK, I moved that. Patch attached.

  +static size_t
  +openal_play(void *data, const void *chunk, size_t size,
  +   G_GNUC_UNUSED GError **error)
  +{
  +   struct openal_data *od = data;
  +   ALuint buffer;
  +   ALint num;
  +
  +   if (alcGetCurrentContext() != od-context) {
  +   alcMakeContextCurrent(od-context);
  +   }
  +
  +   if (od-filled  NUM_BUFFERS) {
  +   /* fill all buffers */
  +   buffer = od-buffers[od-filled];
  +   od-filled++;
  +   } else {
  +   alGetSourcei(od-source, AL_BUFFERS_PROCESSED, num);
  +
  +   /* wait for processed buffer */
  +   while (num  1) {
  +   if (!od-timer-started) {
  +   timer_start(od-timer);
  +   } else {
  +   timer_sync(od-timer);
  +   }
  +
  +   timer_add(od-timer, size);
 
 I don't know how openal works - why are you using the timer object
 here?  Other plugins rely on the timing of the library (e.g. ALSA's
 snd_pcm_writei() blocks until there is enough room in the buffer).
 

As I understand, OpenAL uses buffer objects, which one should feed with data 
and queue
them to audio source object. The problem is, OpenAL does not block these 
alBufferData calls,
so I must wait for buffer to be processed, then deattach it, feed with some 
data and reattach again.
From dc60a65cfdeed591c3b449c7769d1596a69ee489 Mon Sep 17 00:00:00 2001
From: Serge Ziryukin ftrvxm...@gmail.com
Date: Mon, 31 Aug 2009 10:26:22 +0300
Subject: [PATCH] openal output plugin

---
 Makefile.am|4 +
 configure.ac   |   25 
 src/output/openal_plugin.c |  267 
 src/output_list.c  |4 +
 4 files changed, 300 insertions(+), 0 deletions(-)
 create mode 100644 src/output/openal_plugin.c

diff --git a/Makefile.am b/Makefile.am
index b017d97..5a6a8da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -590,6 +590,10 @@ OUTPUT_SRC += src/output/oss_plugin.c
 MIXER_SRC += src/mixer/oss_mixer.c
 endif
 
+if HAVE_OPENAL
+OUTPUT_SRC += src/output/openal_plugin.c
+endif
+
 if HAVE_OSX
 OUTPUT_SRC += src/output/osx_plugin.c
 endif
diff --git a/configure.ac b/configure.ac
index e730c69..b74fbf9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -711,6 +711,11 @@ AC_ARG_ENABLE(oss,
 		[disable OSS support (default: enable)]),,
 	enable_oss=yes)
 
+AC_ARG_ENABLE(openal,
+	AS_HELP_STRING([--enable-openal],
+		[enable OpenAL support (default: disable)]),,
+	enable_openal=no)
+
 AC_ARG_ENABLE(pulse,
 	AS_HELP_STRING([--enable-pulse],
 		[enable support for the PulseAudio sound server]),,
@@ -779,6 +784,19 @@ fi
 
 AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes)
 
+if test x$enable_openal = xyes; then
+	PKG_CHECK_MODULES([OPENAL], [openal],
+		AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]),
+		enable_openal=no)
+fi
+
+if test x$enable_openal = xyes; then
+	MPD_CFLAGS=$MPD_CFLAGS $OPENAL_CFLAGS
+	MPD_LIBS=$MPD_LIBS $OPENAL_LIBS
+fi
+
+AM_CONDITIONAL(HAVE_OPENAL, test x$enable_openal = xyes)
+
 if test x$enable_fifo = xyes; then
 	AC_CHECK_FUNC([mkfifo],
 		[enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1,
@@ -1297,6 +1315,12 @@ else
 	echo  OSS support ...disabled
 fi
 
+if test x$enable_openal = xyes; then
+	echo  OpenAL support enabled
+else
+	echo  OpenAL support disabled
+fi
+
 if test x$enable_osx = xyes; then
 	echo  OS X support ..enabled
 else
@@ -1338,6 +1362,7 @@ echo 
 if
 	test x$enable_ao = xno 
 	test x$enable_oss = xno 
+	test x$enable_openal = xno 
 	test x$enable_shout = xno 
 	test x$enable_recorder_output = xno 
 	test x$enable_httpd_output = xno 
diff --git a/src/output/openal_plugin.c b/src/output/openal_plugin.c
new file mode 100644
index 000..2d581eb
--- /dev/null
+++ b/src/output/openal_plugin.c
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2003-2009 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

[Musicpd-dev-team] [PATCH] modplug: get track length

2009-07-15 Thread Serge Ziryukin

---
 src/decoder/modplug_plugin.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c
index f636f2f..31f0a47 100644
--- a/src/decoder/modplug_plugin.c
+++ b/src/decoder/modplug_plugin.c
@@ -186,7 +186,7 @@ static struct tag *mod_tagdup(const char *file)
return NULL;
 }
ret = tag_new();
-   ret-time = 0;
+   ret-time = ModPlug_GetLength(f) / 1000;
 
title = g_strdup(ModPlug_GetName(f));
if (title)
-- 
1.6.3.2


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH] flac: load external cue sheet when no internal one

2009-07-09 Thread Serge Ziryukin
External cue sheet file for file.flac should be named as file.flac.cue.

---
 src/decoder/flac_plugin.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 965a8b4..41e0f3a 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -300,6 +300,8 @@ flac_cue_tag_load(const char *file)
FLAC__uint64 track_time = 0;
 #ifdef HAVE_CUE /* libcue */
FLAC__StreamMetadata* vc = 
FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
+char* cs_filename;
+FILE* cs_file;
 #endif /* libcue */
FLAC__StreamMetadata* si = 
FLAC__metadata_object_new(FLAC__METADATA_TYPE_STREAMINFO);
FLAC__StreamMetadata* cs = 
FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET);
@@ -328,6 +330,23 @@ flac_cue_tag_load(const char *file)
}
FLAC__metadata_object_delete(vc);
}
+
+if (tag == NULL)
+{
+cs_filename = g_strconcat(file, .cue, NULL);
+
+if (cs_filename != NULL)
+{
+cs_file = fopen(cs_filename, rt);
+g_free(cs_filename);
+
+if (cs_file != NULL)
+{
+tag = cue_tag_file(cs_file, tnum);
+fclose(cs_file);
+}
+}
+}
 #endif /* libcue */
 
if (tag == NULL)
-- 
1.6.3.2


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team