From 8d68e8526cd5688af41d8164d6ad6885f19409de Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Apr 23 2014 19:22:23 +0000 Subject: Run autoreconf -fi to prevent build failure with Rawhide. --- diff --git a/audacious-plugin-fc-0.7-aud45.patch b/audacious-plugin-fc-0.7-aud45.patch new file mode 100644 index 0000000..1babc07 --- /dev/null +++ b/audacious-plugin-fc-0.7-aud45.patch @@ -0,0 +1,270 @@ +diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/ChangeLog audacious-plugin-fc-0.7-aud45/ChangeLog +--- audacious-plugin-fc-0.7-orig/ChangeLog 2013-02-16 19:02:28.000000000 +0100 ++++ audacious-plugin-fc-0.7-aud45/ChangeLog 2014-03-01 00:00:54.000000000 +0100 +@@ -1,3 +1,12 @@ ++2014-03-01 Michael Schwendt ++ ++ * src/main.c: update for changed tuple_set_*() number of arguments ++ ++2013-09-24 Michael Schwendt ++ ++ * configure.ac, src/main.c, src/plugin.c: port to ++ Audacious 3.5-devel plugin API (45) ++ + 2013-02-16 Michael Schwendt + + * src/plugin.c: use .about_text instead of GTK+ +diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/configure.ac audacious-plugin-fc-0.7-aud45/configure.ac +--- audacious-plugin-fc-0.7-orig/configure.ac 2013-02-16 19:56:54.000000000 +0100 ++++ audacious-plugin-fc-0.7-aud45/configure.ac 2014-03-01 00:03:39.144924246 +0100 +@@ -22,14 +22,14 @@ + AC_MSG_ERROR([libfc14audiodecoder not found]) + fi + +-PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 3.3], [], +- AC_MSG_ERROR([Could not find Audacious >= 3.3 API pkgconfig file.])) ++PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 3.5], [], ++ AC_MSG_ERROR([Could not find Audacious >= 3.5 API pkgconfig file.])) + +-AC_MSG_CHECKING([for Audacious input plug-in directory]) +-audfc_iplugin_dir=`$PKG_CONFIG --variable=input_plugin_dir audacious` +-test -n "$audfc_iplugin_dir" && AC_MSG_RESULT([$audfc_iplugin_dir]) +-test "x$audfc_iplugin_dir" == "x" && AC_MSG_ERROR([check failed]) +-AUDACIOUS_IPLUGIN_DIR="$audfc_iplugin_dir" ++AC_MSG_CHECKING([for Audacious plug-in directory]) ++audfc_plugin_dir=`$PKG_CONFIG --variable=plugin_dir audacious` ++test -n "$audfc_plugin_dir" && AC_MSG_RESULT([$audfc_plugin_dir]) ++test "x$audfc_plugin_dir" == "x" && AC_MSG_ERROR([check failed]) ++AUDACIOUS_IPLUGIN_DIR="$audfc_plugin_dir/Input" + AC_SUBST([AUDACIOUS_IPLUGIN_DIR]) + + PKG_CHECK_MODULES([GLIB], [glib-2.0], [], AC_MSG_ERROR([Could not find GLib 2.])) +diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/src/main.c audacious-plugin-fc-0.7-aud45/src/main.c +--- audacious-plugin-fc-0.7-orig/src/main.c 2013-02-16 18:30:54.000000000 +0100 ++++ audacious-plugin-fc-0.7-aud45/src/main.c 2014-02-28 23:59:49.000000000 +0100 +@@ -19,12 +19,13 @@ + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + #include ++#include + #include + #include + #include + +-#if _AUD_PLUGIN_VERSION < 37 +-#error "At least Audacious 3.2-alpha1 is required." ++#if _AUD_PLUGIN_VERSION < 45 ++#error "At least Audacious 3.5-devel is required." + #endif + + #include "config.h" +@@ -37,26 +38,12 @@ + gint zeroSample; + }; + +-static GMutex *seek_mutex; +-static GCond *seek_cond; +-static gint jumpToTime = -1; +-static gboolean stop_flag = FALSE; +- + gboolean ip_init(void) { +- jumpToTime = -1; +- seek_mutex = g_mutex_new(); +- seek_cond = g_cond_new(); +- + fc_ip_load_config(); + + return TRUE; + } + +-void ip_cleanup(void) { +- g_cond_free(seek_cond); +- g_mutex_free(seek_mutex); +-} +- + gint ip_is_valid_file_vfs(const gchar *fileName, VFSFile *fd) { + void *dec; + unsigned char magicBuf[5]; +@@ -71,8 +58,7 @@ + return ret; + } + +-gboolean ip_play(InputPlayback *playback, const gchar *filename, VFSFile *fd, +- gint start_time, gint stop_time, gboolean pause) { ++gboolean ip_play(const gchar *filename, VFSFile *fd) { + void *decoder = NULL; + gpointer sampleBuf = NULL; + size_t sampleBufSize; +@@ -87,9 +73,6 @@ + return FALSE; + } + +- jumpToTime = (start_time > 0) ? start_time : -1; +- stop_flag = FALSE; +- + if ( vfs_fseek(fd,0,SEEK_END)!=0 ) { + return FALSE; + } +@@ -130,9 +113,9 @@ + myFormat.zeroSample = 0x0000; + } + if (myFormat.freq>0 && myFormat.channels>0) { +- audioDriverOK = (playback->output->open_audio(myFormat.xmmsAFormat, ++ audioDriverOK = aud_input_open_audio(myFormat.xmmsAFormat, + myFormat.freq, +- myFormat.channels) != 0); ++ myFormat.channels); + } + if ( !audioDriverOK ) { + // Try some audio configurations regardless of whether the +@@ -152,9 +135,9 @@ + int i = 0; + do { + myFormat = formatList[i]; +- if (playback->output->open_audio(myFormat.xmmsAFormat, ++ if (!aud_input_open_audio(myFormat.xmmsAFormat, + myFormat.freq, +- myFormat.channels) != 0) ++ myFormat.channels)) + { + audioDriverOK = TRUE; + break; +@@ -163,9 +146,6 @@ + while (formatList[++i].bits != 0); + } + if ( audioDriverOK ) { +- if (pause) { +- playback->output->pause(TRUE); +- } + sampleBufSize = 512*(myFormat.bits/8)*myFormat.channels; + sampleBuf = g_malloc(sampleBufSize); + haveSampleBuf = (sampleBuf != NULL); +@@ -176,78 +156,33 @@ + int msecSongLen = fc14dec_duration(decoder); + + Tuple *t = tuple_new_from_filename( filename ); +- tuple_set_int(t, FIELD_LENGTH, NULL, msecSongLen); +- tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced"); +- playback->set_tuple( playback, t ); ++ tuple_set_int(t, FIELD_LENGTH, msecSongLen); ++ tuple_set_str(t, FIELD_QUALITY, "sequenced"); ++ aud_input_set_tuple( t ); + ++ // TODO + /* bitrate => 4*1000 will be displayed as "4 CHANNELS" */ +- playback->set_params( playback, 1000*4, myFormat.freq, myFormat.channels ); +- +- playback->set_pb_ready(playback); ++ // playback->set_params( playback, 1000*4, myFormat.freq, myFormat.channels ); + +- while ( !stop_flag ) { +- if (stop_time >= 0 && playback->output->written_time () >= stop_time) { +- goto DRAIN; +- } +- g_mutex_lock(seek_mutex); ++ while ( !aud_input_check_stop() ) { ++ int jumpToTime = aud_input_check_seek(); + if ( jumpToTime != -1 ) { + fc14dec_seek(decoder,jumpToTime); +- playback->output->flush(jumpToTime); +- jumpToTime = -1; +- g_cond_signal(seek_cond); + } +- g_mutex_unlock(seek_mutex); + + fc14dec_buffer_fill(decoder,sampleBuf,sampleBufSize); +- if ( !stop_flag && jumpToTime<0 ) { +- playback->output->write_audio(sampleBuf,sampleBufSize); +- } +- if ( fc14dec_song_end(decoder) && jumpToTime<0 ) { +- stop_flag = TRUE; +- DRAIN: ++ aud_input_write_audio(sampleBuf,sampleBufSize); ++ if ( fc14dec_song_end(decoder) ) { + break; + } + } + } +- g_mutex_lock(seek_mutex); +- stop_flag = TRUE; +- g_cond_signal(seek_cond); /* wake up any waiting request */ +- g_mutex_unlock(seek_mutex); + + g_free(sampleBuf); + fc14dec_delete(decoder); + return TRUE; + } + +-void ip_stop(InputPlayback *playback) { +- g_mutex_lock(seek_mutex); +- if (!stop_flag) { +- stop_flag = TRUE; +- playback->output->abort_write(); +- g_cond_signal(seek_cond); +- } +- g_mutex_unlock(seek_mutex); +-} +- +-void ip_pause(InputPlayback *playback, gboolean p) { +- g_mutex_lock(seek_mutex); +- if (!stop_flag) { +- playback->output->pause(p); +- } +- g_mutex_unlock(seek_mutex); +-} +- +-void ip_mseek(InputPlayback *playback, gint msec) { +- g_mutex_lock(seek_mutex); +- if (!stop_flag) { +- jumpToTime = msec; +- playback->output->abort_write(); +- g_cond_signal(seek_cond); +- g_cond_wait(seek_cond, seek_mutex); +- } +- g_mutex_unlock(seek_mutex); +-} +- + Tuple *ip_probe_for_tuple(const gchar *filename, VFSFile *fd) { + void *decoder = NULL; + gpointer fileBuf = NULL; +@@ -272,8 +207,8 @@ + decoder = fc14dec_new(); + if (fc14dec_init(decoder,fileBuf,fileLen)) { + t = tuple_new_from_filename(filename); +- tuple_set_int(t, FIELD_LENGTH, NULL, fc14dec_duration(decoder)); +- tuple_set_str(t, FIELD_QUALITY, NULL, "sequenced"); ++ tuple_set_int(t, FIELD_LENGTH, fc14dec_duration(decoder)); ++ tuple_set_str(t, FIELD_QUALITY, "sequenced"); + } + else { + t = NULL; +diff -Nurb --strip-trailing-cr audacious-plugin-fc-0.7-orig/src/plugin.c audacious-plugin-fc-0.7-aud45/src/plugin.c +--- audacious-plugin-fc-0.7-orig/src/plugin.c 2013-02-16 19:02:34.000000000 +0100 ++++ audacious-plugin-fc-0.7-aud45/src/plugin.c 2014-03-01 00:03:39.146924138 +0100 +@@ -12,14 +12,8 @@ + extern PluginPreferences fc_ip_preferences; + + gboolean ip_init(void); +-void ip_cleanup(void); + gint ip_is_valid_file_vfs(const gchar *filename, VFSFile *fd); +-gboolean ip_play(InputPlayback *playback, const gchar *filename, VFSFile *fd, +- gint start_time, gint stop_time, gboolean pause); +-void ip_stop(InputPlayback *playback); +-void ip_pause(InputPlayback *playback, gboolean p); +-void ip_seek(InputPlayback *playback, gint secs); +-void ip_mseek(InputPlayback *playback, gint msec); ++gboolean ip_play(const gchar *filename, VFSFile *fd); + Tuple *ip_probe_for_tuple(const gchar *filename, VFSFile *fd); + + AUD_INPUT_PLUGIN +@@ -31,10 +25,6 @@ + .have_subtune = FALSE, + .extensions = fc_fmts, + .play = ip_play, +- .stop = ip_stop, +- .pause = ip_pause, +- .mseek = ip_mseek, +- .cleanup = ip_cleanup, + .probe_for_tuple = ip_probe_for_tuple, + .is_our_file_from_vfs = ip_is_valid_file_vfs + ) diff --git a/audacious-plugin-fc.spec b/audacious-plugin-fc.spec index 3f0ac82..a0e8a17 100644 --- a/audacious-plugin-fc.spec +++ b/audacious-plugin-fc.spec @@ -1,24 +1,26 @@ -%global aud_plugin_api %(grep '[ ]*#define[ ]*_AUD_PLUGIN_VERSION[ ]\\+' %{_includedir}/audacious/plugin.h 2>/dev/null | sed 's!.*_AUD_PLUGIN_VERSION[ ]*\\([0-9]\\+\\).*!\\1!') +%global aud_plugin_api %(grep '[ ]*#define[ ]*_AUD_PLUGIN_VERSION[ ]\\+' %{_includedir}/audacious/api.h 2>/dev/null | sed 's!.*_AUD_PLUGIN_VERSION[ ]*\\([0-9]\\+\\).*!\\1!') %if 0%{aud_plugin_api} > 0 %global aud_plugin_dep Requires: audacious(plugin-api)%{?_isa} = %{aud_plugin_api} %endif %{?aud_plugin_dep} -%global plugindir %(pkg-config audacious --variable=input_plugin_dir 2>/dev/null) +%global plugindir %(pkg-config audacious --variable=plugin_dir 2>/dev/null) Summary: Future Composer input plugin for Audacious Name: audacious-plugin-fc Version: 0.7 -Release: 2%{?dist} +Release: 5%{?dist} Provides: audacious-plugins-fc = %{version}-%{release} URL: http://xmms-fc.sourceforge.net/ License: GPLv2+ Group: Applications/Multimedia Source: http://downloads.sourceforge.net/xmms-fc/audacious-plugin-fc-%{version}.tar.bz2 +Patch0: audacious-plugin-fc-0.7-aud45.patch -BuildRequires: audacious-devel >= 3.3 +BuildRequires: audacious-devel >= 3.5 BuildRequires: libfc14audiodecoder-devel BuildRequires: pkgconfig +BuildRequires: libtool automake %description @@ -31,6 +33,8 @@ music files from AMIGA. Song-length detection and seek are implemented, too. %{!?aud_plugin_dep:echo 'No audacious(plugin-api) dependency!' && exit -1} %setup -q +%patch0 -p1 -b .old-api +autoreconf -fi %build @@ -44,11 +48,20 @@ make DESTDIR=${RPM_BUILD_ROOT} install %files %doc COPYING README -%{plugindir}/fcdecoder.so -%exclude %{plugindir}/fcdecoder.la +%{plugindir}/Input/fcdecoder.so +%exclude %{plugindir}/Input/fcdecoder.la %changelog +* Sat Mar 1 2014 Michael Schwendt - 0.7-5 +- Run autoreconf -fi to prevent build failure with Rawhide. + +* Fri Feb 28 2014 Michael Schwendt - 0.7-4 +- Update aud_plugin_api global to examine api.h header. + +* Tue Sep 24 2013 Michael Schwendt - 0.7-3 +- Port to Audacious 3.5 Plugin API version 45. + * Sat Aug 03 2013 Fedora Release Engineering - 0.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild