Projects
Multimedia
audacious-plugins
Sign Up
Log In
Username
Password
Sorry, you are not authorized to perform this action.
×
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 14
View file
audacious-plugins.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Feb 23 00:00:00 UTC 2011 - detlef@links2linux.de + +- new upstream version <2.4.4> + +------------------------------------------------------------------- Fri Jan 14 00:00:00 UTC 2011 - detlef@links2linux.de - new upstream version <2.4.3>
View file
audacious-plugins.spec
Changed
@@ -3,7 +3,7 @@ %define grp Productivity/Multimedia/Sound/Players Name: audacious-plugins -Version: 2.4.3 +Version: 2.4.4 Release: 1 Summary: Plugins for Audacious
View file
audacious-plugins-2.4.3.tgz/config.h.in -> audacious-plugins-2.4.4.tgz/config.h.in
Changed
@@ -123,6 +123,9 @@ */ #undef HAVE_SIDPLAY2_DISTORTION +/* Define if you have snd_device_name_hint */ +#undef HAVE_SND_DEVICE_NAME_HINT + /* Define to 1 if you have the <soundcard.h> header file. */ #undef HAVE_SOUNDCARD_H
View file
audacious-plugins-2.4.3.tgz/configure -> audacious-plugins-2.4.4.tgz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for audacious-plugins 2.4.3. +# Generated by GNU Autoconf 2.68 for audacious-plugins 2.4.4. # # Report bugs to <bugs+audacious-plugins@atheme.org>. # @@ -560,8 +560,8 @@ # Identity of this package. PACKAGE_NAME='audacious-plugins' PACKAGE_TARNAME='audacious-plugins' -PACKAGE_VERSION='2.4.3' -PACKAGE_STRING='audacious-plugins 2.4.3' +PACKAGE_VERSION='2.4.4' +PACKAGE_STRING='audacious-plugins 2.4.4' PACKAGE_BUGREPORT='bugs+audacious-plugins@atheme.org' PACKAGE_URL='' @@ -692,6 +692,8 @@ JACK_CFLAGS FFMPEG_LIBS FFMPEG_CFLAGS +NEED_AVCORE_LIBS +NEED_AVCORE_CFLAGS SNDFILE_LIBS SNDFILE_CFLAGS FAAD_LIBS @@ -940,6 +942,7 @@ enable_filewriter_flac enable_bs2b enable_resample +enable_lyricwiki ' ac_precious_vars='build_alias host_alias @@ -994,6 +997,8 @@ WAVPACK_LIBS SNDFILE_CFLAGS SNDFILE_LIBS +NEED_AVCORE_CFLAGS +NEED_AVCORE_LIBS FFMPEG_CFLAGS FFMPEG_LIBS JACK_CFLAGS @@ -1577,7 +1582,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures audacious-plugins 2.4.3 to adapt to many kinds of systems. +\`configure' configures audacious-plugins 2.4.4 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1644,7 +1649,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of audacious-plugins 2.4.3:";; + short | recursive ) echo "Configuration of audacious-plugins 2.4.4:";; esac cat <<\_ACEOF @@ -1712,6 +1717,7 @@ --disable-filewriter_flac disable FileWriter FLAC output part (default=enabled) --disable-bs2b disable BS2B effect plugin (default=enabled) --disable-resample disable resample effect plugin (default=enabled) + --disable-lyricwiki disable LyricWiki plugin (default=enabled) Optional Packages: --with-PACKAGE=ARG use PACKAGE ARG=yes @@ -1813,6 +1819,10 @@ C compiler flags for SNDFILE, overriding pkg-config SNDFILE_LIBS linker flags for SNDFILE, overriding pkg-config + NEED_AVCORE_CFLAGS + C compiler flags for NEED_AVCORE, overriding pkg-config + NEED_AVCORE_LIBS + linker flags for NEED_AVCORE, overriding pkg-config FFMPEG_CFLAGS C compiler flags for FFMPEG, overriding pkg-config FFMPEG_LIBS linker flags for FFMPEG, overriding pkg-config @@ -1935,7 +1945,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -audacious-plugins configure 2.4.3 +audacious-plugins configure 2.4.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2471,7 +2481,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by audacious-plugins $as_me 2.4.3, which was +It was created by audacious-plugins $as_me 2.4.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2973,7 +2983,7 @@ PACKAGE=audacious-plugins -VERSION=2.4.3 +VERSION=2.4.4 @@ -4706,6 +4716,7 @@ CXXFLAGS="$CXXFLAGS -pipe -Wall" fi + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" @@ -6974,7 +6985,7 @@ INPUT_PLUGINS="tonegen console xsf metronom vtx" OUTPUT_PLUGINS="null" EFFECT_PLUGINS="compressor crossfade crystalizer ladspa sndstretch stereo_plugin voice_removal echo_plugin" -GENERAL_PLUGINS="song_change alarm skins gtkui lyricwiki" +GENERAL_PLUGINS="song_change alarm skins gtkui" VISUALIZATION_PLUGINS="blur_scope spectrum" CONTAINER_PLUGINS="m3u pls" TRANSPORT_PLUGINS="unix-io" @@ -7728,20 +7739,20 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PULSE" >&5 $as_echo_n "checking for PULSE... " >&6; } if test "x$PKG_CONFIG" != "x"; then - if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse >= 0.9.9\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpulse >= 0.9.9") 2>&5 + if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse >= 0.9.5\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse >= 0.9.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "x${PULSE_CFLAGS}" != "x"; then pkg_cv_PULSE_CFLAGS="${PULSE_CFLAGS}" else - pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse >= 0.9.9" 2>/dev/null` + pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse >= 0.9.5" 2>/dev/null` fi if test "x${PULSE_LIBS}" != "x"; then pkg_cv_PULSE_LIBS="${PULSE_LIBS}" else - pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse >= 0.9.9" 2>/dev/null` + pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse >= 0.9.5" 2>/dev/null` fi else pkg_failed="yes" @@ -7753,9 +7764,9 @@ if test "x$pkg_failed" = "xyes"; then if test "x$_pkg_short_errors_supported" = "xyes"; then - PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpulse >= 0.9.9" 2>&1` + PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpulse >= 0.9.5" 2>&1` else - PULSE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpulse >= 0.9.9" 2>&1` + PULSE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpulse >= 0.9.5" 2>&1` fi echo "$PULSE_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -8463,20 +8474,20 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 $as_echo_n "checking for CAIRO... " >&6; } if test "x$PKG_CONFIG" != "x"; then - if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= 1.2.6\""; } >&5 - ($PKG_CONFIG --exists --print-errors "cairo >= 1.2.6") 2>&5 + if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo >= 1.2.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "cairo >= 1.2.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "x${CAIRO_CFLAGS}" != "x"; then pkg_cv_CAIRO_CFLAGS="${CAIRO_CFLAGS}" else - pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= 1.2.6" 2>/dev/null` + pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= 1.2.4" 2>/dev/null` fi if test "x${CAIRO_LIBS}" != "x"; then pkg_cv_CAIRO_LIBS="${CAIRO_LIBS}" else - pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= 1.2.6" 2>/dev/null` + pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= 1.2.4" 2>/dev/null` fi else pkg_failed="yes" @@ -8488,21 +8499,21 @@ if test "x$pkg_failed" = "xyes"; then if test "x$_pkg_short_errors_supported" = "xyes"; then - CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "cairo >= 1.2.6" 2>&1` + CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "cairo >= 1.2.4" 2>&1` else - CAIRO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "cairo >= 1.2.6" 2>&1` + CAIRO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "cairo >= 1.2.4" 2>&1` fi echo "$CAIRO_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
View file
audacious-plugins-2.4.3.tgz/configure.ac -> audacious-plugins-2.4.4.tgz/configure.ac
Changed
@@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(audacious-plugins, 2.4.3, bugs+audacious-plugins@atheme.org) +AC_INIT(audacious-plugins, 2.4.4, bugs+audacious-plugins@atheme.org) AC_PREREQ(2.59) AC_CANONICAL_HOST @@ -36,6 +36,9 @@ CXXFLAGS="$CXXFLAGS -pipe -Wall" fi +dnl Chainsaw says this is broken. +dnl LDFLAGS="$LDFLAGS -z defs" + dnl Large file support dnl ================== CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" @@ -120,7 +123,7 @@ INPUT_PLUGINS="tonegen console xsf metronom vtx" OUTPUT_PLUGINS="null" EFFECT_PLUGINS="compressor crossfade crystalizer ladspa sndstretch stereo_plugin voice_removal echo_plugin" -GENERAL_PLUGINS="song_change alarm skins gtkui lyricwiki" +GENERAL_PLUGINS="song_change alarm skins gtkui" VISUALIZATION_PLUGINS="blur_scope spectrum" CONTAINER_PLUGINS="m3u pls" TRANSPORT_PLUGINS="unix-io" @@ -232,7 +235,7 @@ ) if test "x$enable_pulse" = "xyes"; then - PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.9, + PKG_CHECK_MODULES(PULSE, libpulse >= 0.9.5, have_pulse=yes OUTPUT_PLUGINS="$OUTPUT_PLUGINS pulse_audio", have_pulse=no @@ -545,9 +548,9 @@ have_aosd="no" AC_MSG_RESULT(*** pango >= 1.14.7 is required for Audacious OSD plugin ***) ) - PKG_CHECK_MODULES(CAIRO,cairo >= 1.2.6,, + PKG_CHECK_MODULES(CAIRO,cairo >= 1.2.4,, have_aosd="no" - AC_MSG_RESULT(*** cairo >= 1.2.6 is required for Audacious OSD plugin ***) + AC_MSG_RESULT(*** cairo >= 1.2.4 is required for Audacious OSD plugin ***) ) PKG_CHECK_MODULES(PANGOCAIRO,pangocairo >= 1.14.7,, have_aosd="no" @@ -778,9 +781,22 @@ enable_ffaudio="yes" ) -if test "x$enable_ffaudio" = "xyes"; then - PKG_CHECK_MODULES(FFMPEG, libavformat >= 52.31.0 libavcodec >= 52.20.0 libavutil >= 49.15.0, - have_ffaudio="yes", have_ffaudio="no") +dnl In 2010, some libavcodec functions were moved into a new library called +dnl libavcore, making our checks here a bit complex. + +if test $enable_ffaudio = yes ; then + PKG_CHECK_MODULES(NEED_AVCORE, libavcodec >= 52.94.3, + have_new_ffmpeg=yes, have_new_ffmpeg=no) + + if test $have_new_ffmpeg = yes ; then + PKG_CHECK_MODULES(FFMPEG, + libavcodec >= 52.20.0 libavcore >= 0.12.0 libavformat >= 52.31.0 libavutil >= 49.15.0, + have_ffaudio=yes, have_ffaudio=no) + else + PKG_CHECK_MODULES(FFMPEG, + libavcodec >= 52.20.0 libavformat >= 52.31.0 libavutil >= 49.15.0, + have_ffaudio=yes, have_ffaudio=no) + fi fi if test "x$have_ffaudio" = "xyes"; then @@ -968,6 +984,8 @@ if test "x$enable_alsa" = "xyes"; then PKG_CHECK_MODULES(ALSA, alsa >= 1.0, have_alsa=yes, have_alsa=no) + AC_CHECK_LIB(asound, snd_device_name_hint, + AC_DEFINE(HAVE_SND_DEVICE_NAME_HINT, 1, Define if you have snd_device_name_hint)) else AC_MSG_RESULT(*** ALSA output plugin disabled per user request ***) have_alsa=no @@ -1469,7 +1487,7 @@ ) if test "x$enable_filewriter_flac" = "xyes"; then - PKG_CHECK_MODULES(FLAC, flac >= 1.1.2, + PKG_CHECK_MODULES(FLAC, flac >= 1.1.3, have_writer_flac=yes, have_writer_flac=no ) if test "x$have_writer_flac" = "xyes"; then @@ -1524,6 +1542,21 @@ EFFECT_PLUGINS="$EFFECT_PLUGINS resample" fi +dnl LyricWiki +dnl ========= + +AC_ARG_ENABLE(lyricwiki, + --disable-lyricwiki disable LyricWiki plugin (default=enabled), + enable_lyricwiki=$enableval, enable_lyricwiki=yes) + +if test "x$enable_lyricwiki" = "xyes"; then + PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14, enable_lyricwiki=yes, enable_lyricwiki=no) +fi + +if test "x$enable_lyricwiki" = "xyes"; then + GENERAL_PLUGINS="$GENERAL_PLUGINS lyricwiki" +fi + dnl *** End of all plugin checks *** AC_SUBST(ARCH_DEFINES) @@ -1664,7 +1697,7 @@ echo " Bluetooth audio support: $have_bluetooth" echo " MacOS Dock Album Art plugin: $have_dockalbumart" echo " Streambrowser: $enable_streambrowser" -echo " LyricWiki viewer: yes" +echo " LyricWiki viewer: $enable_lyricwiki" echo echo " Effect" echo " ------"
View file
audacious-plugins-2.4.3.tgz/src/aac/libmp4.c -> audacious-plugins-2.4.4.tgz/src/aac/libmp4.c
Changed
@@ -24,7 +24,8 @@ */ #define BUFFER_SIZE (FAAD_MIN_STREAMSIZE * 16) -#define M4A_MAGIC (unsigned char 11) { 0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41 } +static const guchar M4A_MAGIC11 = {0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, + 0x70, 0x4D, 0x34, 0x41}; static void mp4_init(void); static void mp4_about(void); @@ -264,20 +265,23 @@ return success; } -static gint mp4_is_our_fd(const gchar *filename, VFSFile* file) +static gboolean mp4_is_our_fd (const gchar * filename, VFSFile * file) { - gchar magicsizeof(M4A_MAGIC); + gchar magicsizeof M4A_MAGIC; - vfs_fread(magic, 1, sizeof(M4A_MAGIC), file); - if (!memcmp(magic, M4A_MAGIC, 11)) - return 1; + if (vfs_fread (magic, 1, sizeof magic, file) != sizeof magic) + return FALSE; + if (! memcmp (magic, M4A_MAGIC, sizeof magic)) + return TRUE; - vfs_rewind(file); - if (parse_aac_stream(file) == TRUE) - return 1; + if (vfs_fseek (file, 0, SEEK_SET)) + return FALSE; + if (parse_aac_stream (file)) + return TRUE; - vfs_fseek (file, 0, SEEK_SET); - return is_mp4_aac_file (file); + if (vfs_fseek (file, 0, SEEK_SET)) + return FALSE; + return is_mp4_aac_file (file); } static void mp4_about(void) @@ -326,8 +330,8 @@ * channels = -1; /* look for a representative bitrate in the middle of the file */ - if (size > 0) - vfs_fseek (handle, size / 2, SEEK_SET); + if (size > 0 && vfs_fseek (handle, size / 2, SEEK_SET)) + goto DONE; for (found = 0; found < 32; found ++) { @@ -547,7 +551,8 @@ if (parse_aac_stream (handle)) return aac_get_tuple (filename, handle); - vfs_fseek (handle, 0, SEEK_SET); + if (vfs_fseek (handle, 0, SEEK_SET)) + return NULL; mp4cb.read = mp4_read_callback; mp4cb.seek = mp4_seek_callback; @@ -814,13 +819,14 @@ return; } if(!strncmp((char*)streambuffer, "ID3", 3)){ - gint size = 0; + if (vfs_fseek (file, 10 + (streambuffer6 << 21) + (streambuffer7 << + 14) + (streambuffer8 << 7) + streambuffer9, SEEK_SET)) + { + playback->playing = FALSE; + playback->error = TRUE; + return; + } - vfs_fseek(file, 0, SEEK_SET); - size = (streambuffer6<<21) | (streambuffer7<<14) | - (streambuffer8<<7) | streambuffer9; - size+=10; - vfs_fread(streambuffer, 1, size, file); buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file); } @@ -970,7 +976,10 @@ ret = parse_aac_stream(mp4fh); if( ret == TRUE ) - vfs_fseek(mp4fh, 0, SEEK_SET); + { + if (vfs_fseek (mp4fh, 0, SEEK_SET)) + ; /* errors here are normal for streaming */ + } else { vfs_fclose(mp4fh); mp4fh = vfs_fopen(filename, "rb");
View file
audacious-plugins-2.4.3.tgz/src/adplug/adplug-xmms.cc -> audacious-plugins-2.4.4.tgz/src/adplug/adplug-xmms.cc
Changed
@@ -77,7 +77,7 @@ CPlayers players; } conf = { -44100l, true, false, false, CAdPlug::players}; +44100l, true, false, false, CAdPlug::getPlayers()}; // Player variables static struct @@ -392,7 +392,7 @@ gtk_clist_set_selection_mode (fl, GTK_SELECTION_MULTIPLE); // Build list - for (i = CAdPlug::players.begin (); i != CAdPlug::players.end (); i++) + for (i = CAdPlug::getPlayers().begin (); i != CAdPlug::getPlayers().end (); i++) { gint rownum; @@ -1068,8 +1068,8 @@ dbg_printf ("exclude, "); std::string exclude; - for (CPlayers::const_iterator i = CAdPlug::players.begin (); - i != CAdPlug::players.end (); i++) + for (CPlayers::const_iterator i = CAdPlug::getPlayers().begin (); + i != CAdPlug::getPlayers().end (); i++) if (find (conf.players.begin (), conf.players.end (), *i) == conf.players.end ()) {
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/a2m.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/a2m.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -29,6 +29,8 @@ * Following commands are ignored: Gxy, Hxy, Kxy - &xy */ +#include <string.h> + #include "a2m.h" const unsigned int
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/adl.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/adl.cxx
Changed
@@ -45,9 +45,10 @@ * */ +#include <assert.h> #include <inttypes.h> #include <stdarg.h> -#include <assert.h> +#include <string.h> #include "adl.h" #include "debug.h" @@ -833,7 +834,7 @@ { // Each channel runs its own program. There are ten channels: One for // each Adlib channel (0-8), plus one "control channel" (9) which is - // the one that tells the other channels what to do. + // the one that tells the other channels what to do. for (_curChannel = 9; _curChannel >= 0; --_curChannel) { @@ -922,7 +923,7 @@ } } -// +// void AdlibDriver::resetAdlibState ()
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/adplug.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/adplug.cxx
Changed
@@ -76,7 +76,7 @@ /***** CAdPlug *****/ // List of all players that come with the standard AdPlug distribution -const CPlayerDesc +/*const CPlayerDesc CAdPlug::allplayers = { CPlayerDesc (ChscPlayer::factory, "HSC-Tracker", ".hsc\0"), CPlayerDesc (CsngPlayer::factory, "SNGPlay", ".sng\0"), @@ -121,7 +121,7 @@ CPlayerDesc (CjbmPlayer::factory, "Johannes Bjerregaard", ".jbm\0"), CPlayerDesc () }; - +*/ const CPlayers & CAdPlug::init_players (const CPlayerDesc pd) @@ -135,8 +135,56 @@ return initplayers; } -const CPlayers - CAdPlug::players = CAdPlug::init_players (CAdPlug::allplayers); +const CPlayers& CAdPlug::getPlayers() { + static const CPlayerDesc + _allplayers = { + CPlayerDesc (ChscPlayer::factory, "HSC-Tracker", ".hsc\0"), + CPlayerDesc (CsngPlayer::factory, "SNGPlay", ".sng\0"), + CPlayerDesc (CimfPlayer::factory, "Apogee IMF", ".imf\0.wlf\0.adlib\0"), + CPlayerDesc (Ca2mLoader::factory, "Adlib Tracker 2", ".a2m\0"), + CPlayerDesc (CadtrackLoader::factory, "Adlib Tracker", ".sng\0"), + CPlayerDesc (CamdLoader::factory, "AMUSIC", ".amd\0"), + CPlayerDesc (CbamPlayer::factory, "Bob's Adlib Music", ".bam\0"), + CPlayerDesc (CcmfPlayer::factory, "Creative Music File", ".cmf\0"), + CPlayerDesc (Cd00Player::factory, "Packed EdLib", ".d00\0"), + CPlayerDesc (CdfmLoader::factory, "Digital-FM", ".dfm\0"), + CPlayerDesc (ChspLoader::factory, "HSC Packed", ".hsp\0"), + CPlayerDesc (CksmPlayer::factory, "Ken Silverman Music", ".ksm\0"), + CPlayerDesc (CmadLoader::factory, "Mlat Adlib Tracker", ".mad\0"), + CPlayerDesc (CmidPlayer::factory, "MIDI", ".sci\0.laa\0"), + CPlayerDesc (CmkjPlayer::factory, "MKJamz", ".mkj\0"), + CPlayerDesc (CcffLoader::factory, "Boomtracker", ".cff\0"), + CPlayerDesc (CdmoLoader::factory, "TwinTeam", ".dmo\0"), + CPlayerDesc (Cs3mPlayer::factory, "Scream Tracker 3", ".s3m\0"), + CPlayerDesc (CdtmLoader::factory, "DeFy Adlib Tracker", ".dtm\0"), + CPlayerDesc (CfmcLoader::factory, "Faust Music Creator", ".sng\0"), + CPlayerDesc (CmtkLoader::factory, "MPU-401 Trakker", ".mtk\0"), + CPlayerDesc (CradLoader::factory, "Reality Adlib Tracker", ".rad\0"), + CPlayerDesc (CrawPlayer::factory, "RdosPlay RAW", ".raw\0"), + CPlayerDesc (Csa2Loader::factory, "Surprise! Adlib Tracker", + ".sat\0.sa2\0"), + CPlayerDesc (CxadbmfPlayer::factory, "BMF Adlib Tracker", ".xad\0"), + CPlayerDesc (CxadflashPlayer::factory, "Flash", ".xad\0"), + CPlayerDesc (CxadhybridPlayer::factory, "Hybrid", ".xad\0"), + CPlayerDesc (CxadhypPlayer::factory, "Hypnosis", ".xad\0"), + CPlayerDesc (CxadpsiPlayer::factory, "PSI", ".xad\0"), + CPlayerDesc (CxadratPlayer::factory, "rat", ".xad\0"), + CPlayerDesc (CldsPlayer::factory, "LOUDNESS Sound System", ".lds\0"), + CPlayerDesc (Cu6mPlayer::factory, "Ultima 6 Music", ".m\0"), + CPlayerDesc (CrolPlayer::factory, "Adlib Visual Composer", ".rol\0"), + CPlayerDesc (CxsmPlayer::factory, "eXtra Simple Music", ".xsm\0"), + CPlayerDesc (CdroPlayer::factory, "DOSBox Raw OPL v0.1", ".dro\0"), + CPlayerDesc (Cdro2Player::factory, "DOSBox Raw OPL v2.0", ".dro\0"), + CPlayerDesc (CmscPlayer::factory, "Adlib MSC Player", ".msc\0"), + CPlayerDesc (CrixPlayer::factory, "Softstar RIX OPL Music", ".rix\0"), + CPlayerDesc (CadlPlayer::factory, "Westwood ADL", ".adl\0"), + CPlayerDesc (CjbmPlayer::factory, "Johannes Bjerregaard", ".jbm\0"), + CPlayerDesc () + }; + static CPlayers players = CAdPlug::init_players(_allplayers); + return players; +} + CAdPlugDatabase * CAdPlug::database = 0;
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/adplug.h -> audacious-plugins-2.4.4.tgz/src/adplug/core/adplug.h
Changed
@@ -35,10 +35,10 @@ friend CPlayer::CPlayer(Copl *newopl); public: - static const CPlayers players; + static const CPlayers& getPlayers(); static CPlayer *factory(VFSFile *fd, Copl *opl, - const CPlayers &pl = players, + const CPlayers &pl = getPlayers(), const CFileProvider &fp = CProvider_Filesystem()); static void set_database(CAdPlugDatabase *db); @@ -47,7 +47,6 @@ private: static CAdPlugDatabase *database; - static const CPlayerDesc allplayers; static const CPlayers &init_players(const CPlayerDesc pd); };
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/binio_virtual.h -> audacious-plugins-2.4.4.tgz/src/adplug/core/binio_virtual.h
Changed
@@ -7,127 +7,139 @@ #define __BINIO_VIRTUAL__ #include <binio.h> -#include <binstr.h> - -#include <string> - -#include <glib.h> extern "C" { -#include <audacious/plugin.h> +#include <libaudcore/vfs.h> }; -class vfsistream : public binistream, virtual public binio { +class vfsistream : public binistream { private: VFSFile *fd; public: - vfsistream() {}; - ~vfsistream() {}; + vfsistream() { + this->fd = 0; + }; + + ~vfsistream() { + if (this->fd) { + vfs_fclose(this->fd); + this->fd = 0; + } + }; vfsistream(VFSFile *fd) { this->fd = fd; }; vfsistream(const char *file) { - this->fd = vfs_fopen(file, "rb"); + this->fd = vfs_fopen(file, "r"); + if (!this->fd) + err |= NotFound; }; vfsistream(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "rb"); + this->fd = vfs_fopen(file.c_str(), "r"); + if (!this->fd) + err |= NotFound; }; void open(const char *file) { - this->fd = vfs_fopen(file, "rb"); + g_return_if_fail(!this->fd); + this->fd = vfs_fopen(file, "r"); + if (!this->fd) + err |= NotFound; }; void open(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "rb"); + g_return_if_fail(!this->fd); + this->fd = vfs_fopen(file.c_str(), "r"); + if (!this->fd) + err |= NotFound; }; - // XXX: this sucks because binio won't let us do sanity checking Byte getByte(void) { + g_return_val_if_fail(this->fd, EOF); int c = vfs_getc(this->fd); - - if (c == EOF) err |= Eof; - + if (c < 0) + err |= Eof; return (Byte) c; }; void seek(long pos, Offset offs = Set) { - switch (offs) - { - case Add: - vfs_fseek(this->fd, pos, SEEK_CUR); - break; - case End: - vfs_fseek(this->fd, pos, SEEK_END); - break; - case Set: - default: - vfs_fseek(this->fd, pos, SEEK_SET); - break; - } - + g_return_if_fail(this->fd); + int wh = (offs == Add) ? SEEK_CUR : (offs == End) ? SEEK_END : SEEK_SET; + if (vfs_fseek(this->fd, pos, wh)) + err |= Eof; } long pos(void) { + g_return_val_if_fail(this->fd, -1); return vfs_ftell(this->fd); } }; -// XXX: binio sucks and doesn't let us just combine the two. -class vfsostream : public binostream, virtual public binio { +class vfsostream : public binostream { private: VFSFile *fd; public: - vfsostream() {}; - ~vfsostream() {}; + vfsostream() { + this->fd = 0; + }; + + ~vfsostream() { + if (this->fd) { + vfs_fclose(this->fd); + this->fd = 0; + } + }; vfsostream(VFSFile *fd) { this->fd = fd; }; vfsostream(const char *file) { - this->fd = vfs_fopen(file, "wb"); + this->fd = vfs_fopen(file, "w"); + if (!this->fd) + err |= Denied; }; vfsostream(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "wb"); + this->fd = vfs_fopen(file.c_str(), "w"); + if (!this->fd) + err |= Denied; }; void open(const char *file) { - this->fd = vfs_fopen(file, "wb"); + g_return_if_fail(!this->fd); + this->fd = vfs_fopen(file, "w"); + if (!this->fd) + err |= Denied; }; void open(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "wb"); + g_return_if_fail(!this->fd); + this->fd = vfs_fopen(file.c_str(), "w"); + if (!this->fd) + err |= Denied; }; - // XXX: this sucks because binio won't let us do sanity checking void putByte(Byte b) { - vfs_fwrite(&b, 1, 1, this->fd); + g_return_if_fail(this->fd); + if (vfs_fwrite(&b, 1, 1, this->fd) != 1) + err |= Fatal; }; void seek(long pos, Offset offs = Set) { - switch (offs) - { - case Add: - vfs_fseek(this->fd, pos, SEEK_CUR); - break; - case End: - vfs_fseek(this->fd, pos, SEEK_END); - break; - case Set: - default: - vfs_fseek(this->fd, pos, SEEK_SET); - break; - } - + g_return_if_fail(this->fd); + int wh = (offs == Add) ? SEEK_CUR : (offs == End) ? SEEK_END : SEEK_SET; + if (vfs_fseek(this->fd, pos, wh)) + err |= Fatal; } long pos(void) { + g_return_val_if_fail(this->fd, -1); return vfs_ftell(this->fd); } };
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/bmf.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/bmf.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2003, 2006 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -40,6 +40,8 @@ comment : inaccurate replaying, because constant outport; in original player it can be 380 or 382. */ +#include <string.h> + #include "bmf.h" #include "debug.h" @@ -540,7 +542,7 @@ if ((0x20 <= *stream) && (*stream <= 0x3F)) { - // 0x20 or higher; 0x3F or lower: Set Instrument + // 0x20 or higher; 0x3F or lower: Set Instrument bmf.streamschannelpos.instrument = *stream - 0x20 + 1; stream++;
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/cff.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/cff.cxx
Changed
@@ -25,6 +25,7 @@ */ #include <stdlib.h> +#include <string.h> #include "cff.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/cmf.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/cmf.cxx
Changed
@@ -548,7 +548,7 @@ 00 -> N/A (note off) */ // Approximate formula, need to figure out more accurate one (my maths isn't so good...) - int iLevel = 0x25 - sqrt(iVelocity * 16/*6*/);//(127 - iVelocity) * 0x20 / 127; + int iLevel = 0x25 - (int) sqrt(iVelocity * 16 /* 6 */); // (127 - iVelocity) * 0x20 / 127; if (iVelocity > 0x7b) iLevel = 0; // full volume if (iLevel < 0) iLevel = 0; if (iLevel > 0x3F) iLevel = 0x3F;
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/dro.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/dro.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -19,11 +19,12 @@ * dro.c - DOSBox Raw OPL Player by Sjoerd van der Berg <harekiet@zophar.net> * * upgraded by matthew gambrell <zeromus@zeromus.org> - * + * * NOTES: 3-oct-04: the DRO format is not yet finalized. beware. */ #include <stdio.h> +#include <string.h> #include "dro.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/dtm.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/dtm.cxx
Changed
@@ -22,6 +22,8 @@ NOTE: Panning (Ex) effect is ignored. */ +#include <string.h> + #include "dtm.h" /* -------- Public Methods -------------------------------- */
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/fmc.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/fmc.cxx
Changed
@@ -19,6 +19,8 @@ fmc.cpp - FMC Loader by Riven the Mage <riven@ok.ru> */ +#include <string.h> + #include "fmc.h" /* -------- Public Methods -------------------------------- */
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/mad.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/mad.cxx
Changed
@@ -19,6 +19,8 @@ mad.cpp - MAD loader by Riven the Mage <riven@ok.ru> */ +#include <string.h> + #include "mad.h" /* -------- Public Methods -------------------------------- */
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/mkj.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/mkj.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2004 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -20,6 +20,7 @@ */ #include <assert.h> +#include <string.h> #include "mkj.h" #include "debug.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/msc.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/msc.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -20,6 +20,7 @@ */ #include <stdio.h> +#include <string.h> #include "msc.h" #include "debug.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/mtk.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/mtk.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -19,6 +19,8 @@ * mtk.cpp - MPU-401 Trakker Loader by Simon Peter (dn.tlp@gmx.net) */ +#include <string.h> + #include "mtk.h" /*** public methods **************************************/
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/protrack.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/protrack.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -25,6 +25,8 @@ * Protracker-like format, this is most certainly the player you want to use. */ +#include <string.h> + #include "protrack.h" #include "debug.h" @@ -266,6 +268,10 @@ else track--; + if (track >= npats*nchans) { // prevent overflow + songend = 1; + return !songend; + } AdPlug_LogWrite ("%3d%3d%2X%2X%2X|", trackstrackrow.note, trackstrackrow.inst, trackstrackrow.command, trackstrackrow.param1, trackstrackrow.param2);
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/rad.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/rad.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -22,6 +22,8 @@ * some volumes are dropped out */ +#include <string.h> + #include "rad.h" CPlayer *
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/rat.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/rat.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2003 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -29,6 +29,8 @@ comment : there are bug in original replayer's adlib_init(): wrong frequency registers. */ +#include <string.h> + #include "rat.h" #include "debug.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/raw.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/raw.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2005 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -19,6 +19,8 @@ * raw.c - RAW Player by Simon Peter <dn.tlp@gmx.net> */ +#include <string.h> + #include "raw.h" /*** public methods *************************************/
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/rix.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/rix.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -20,9 +20,11 @@ * BSPAL <BSPAL.ys168.com> */ +#include <cstdlib> +#include <string.h> + #include "rix.h" #include "debug.h" -#include <cstdlib> const unsigned char CrixPlayer::adflag =
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/rol.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/rol.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -21,6 +21,7 @@ * Visit: http://tenacity.hispeed.com/aomit/oplx/ */ #include <algorithm> +#include <string.h> #include "rol.h" #include "debug.h" @@ -40,8 +41,8 @@ static const unsigned char drum_table4 = {0x14, 0x12, 0x15, 0x11}; -CrolPlayer::uint16 const CrolPlayer::kNoteTable12 = -{ +CrolPlayer::uint16 const CrolPlayer::kNoteTable12 = +{ 340, // C 363, // C# 385, // D @@ -79,7 +80,7 @@ memset(freqCache, 0, sizeof(freqCache) ); for(n=0; n<11; n++) - pitchCachen=1.0f; + pitchCachen=1.0f; } //--------------------------------------------------------- CrolPlayer::~CrolPlayer() @@ -257,6 +258,9 @@ TVolumeEvents &vEvents = voiceData.volume_events; TPitchEvents &pEvents = voiceData.pitch_events; + if (iEvents.empty()) { + return; // prevent out-of-bounds access + } if( !(voiceData.mEventStatus & CVoiceData::kES_InstrEnd ) && iEventsvoiceData.next_instrument_event.time == mCurrTick ) { @@ -271,6 +275,9 @@ } } + if (vEvents.empty()) { + return; // prevent out-of-bounds access + } if( !(voiceData.mEventStatus & CVoiceData::kES_VolumeEnd ) && vEventsvoiceData.next_volume_event.time == mCurrTick ) { @@ -287,7 +294,7 @@ else { voiceData.mEventStatus |= CVoiceData::kES_VolumeEnd; - } + } } if( voiceData.mForceNote || voiceData.current_note_duration > voiceData.mNoteDuration-1 ) @@ -314,6 +321,9 @@ } } + if (pEvents.empty()) { + return; // prevent out-of-bounds access + } if( !(voiceData.mEventStatus & CVoiceData::kES_PitchEnd ) && pEventsvoiceData.next_pitch_event.time == mCurrTick ) { @@ -400,7 +410,7 @@ { volumeCachevoice = (volumeCachevoice &0xc0) | volume; - int const op_offset = ( voice < kSnareDrumChannel || rol_header->mode ) ? + int const op_offset = ( voice < kSnareDrumChannel || rol_header->mode ) ? op_tablevoice+3 : drum_tablevoice-kSnareDrumChannel; opl->write( 0x40+op_offset, volumeCachevoice ); @@ -454,6 +464,9 @@ { int16 const num_tempo_events = f->readInt( 2 ); + if (num_tempo_events<0) { + return; + } mTempoEvents.reserve( num_tempo_events ); for(int i=0; i<num_tempo_events; ++i) @@ -538,6 +551,9 @@ binistream *bnk_file, SBnkHeader const &bnk_header ) { int16 const number_of_instrument_events = f->readInt( 2 ); + if (number_of_instrument_events<0) { + return; + } TInstrumentEvents &instrument_events = voice.instrument_events; @@ -563,6 +579,9 @@ void CrolPlayer::load_volume_events( binistream *f, CVoiceData &voice ) { int16 const number_of_volume_events = f->readInt( 2 ); + if (number_of_volume_events<0) { + return; + } TVolumeEvents &volume_events = voice.volume_events; @@ -583,6 +602,9 @@ void CrolPlayer::load_pitch_events( binistream *f, CVoiceData &voice ) { int16 const number_of_pitch_events = f->readInt( 2 ); + if (number_of_pitch_events<0) { + return; + } TPitchEvents &pitch_events = voice.pitch_events; @@ -647,9 +669,9 @@ typedef TInstrumentNames::const_iterator TInsIter; typedef std::pair<TInsIter, TInsIter> TInsIterPair; - TInsIterPair range = std::equal_range( ins_name_list.begin(), - ins_name_list.end(), - name, + TInsIterPair range = std::equal_range( ins_name_list.begin(), + ins_name_list.end(), + name, StringCompare() ); if( range.first != range.second )
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/s3m.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/s3m.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -22,6 +22,8 @@ * Extra Fine Slides (EEx, FEx) & Fine Vibrato (Uxy) are inaccurate */ +#include <string.h> + #include "s3m.h" const char
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/sa2.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/sa2.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -21,6 +21,7 @@ */ #include <stdio.h> +#include <string.h> #include "sa2.h" #include "debug.h"
View file
audacious-plugins-2.4.3.tgz/src/adplug/core/sng.cxx -> audacious-plugins-2.4.4.tgz/src/adplug/core/sng.cxx
Changed
@@ -1,17 +1,17 @@ /* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2002 Simon Peter, <dn.tlp@gmx.net>, et al. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -19,6 +19,8 @@ * sng.cpp - SNG Player by Simon Peter <dn.tlp@gmx.net> */ +#include <string.h> + #include "sng.h" CPlayer *
View file
audacious-plugins-2.4.3.tgz/src/alsa/alsa.c -> audacious-plugins-2.4.4.tgz/src/alsa/alsa.c
Changed
@@ -139,7 +139,8 @@ static void poll_wake (void) { const char c = 0; - write (poll_pipe1, & c, 1); + if (write (poll_pipe1, & c, 1) < 0) + ERROR ("Failed to write to pipe: %s.\n", strerror (errno)); } static void poll_cleanup (void)
View file
audacious-plugins-2.4.3.tgz/src/alsa/config.c -> audacious-plugins-2.4.4.tgz/src/alsa/config.c
Changed
@@ -69,6 +69,7 @@ static void get_defined_devices (const char * type, int capture, void (* found) (const char * name, const char * description)) { +#ifdef HAVE_SND_DEVICE_NAME_HINT void * * hints = NULL; int count; @@ -94,6 +95,7 @@ FAILED: if (hints != NULL) snd_device_name_free_hint (hints); +#endif } static char * get_card_description (int card)
View file
audacious-plugins-2.4.3.tgz/src/amidi-plug/backend-fluidsynth/b-fluidsynth.c -> audacious-plugins-2.4.4.tgz/src/amidi-plug/backend-fluidsynth/b-fluidsynth.c
Changed
@@ -21,9 +21,6 @@ #include "b-fluidsynth.h" #include "b-fluidsynth-config.h" -/* some versions of fluidsynth don't export this in the public headers */ -extern int fluid_synth_all_notes_off(fluid_synth_t* synth, int chan); - /* sequencer instance */ static sequencer_client_t sc; /* options */ @@ -289,7 +286,7 @@ gint c = 0; for ( c = 0 ; c < 16 ; c++ ) { - fluid_synth_all_notes_off( sc.synth , c ); + fluid_synth_cc (sc.synth, c, 123 /* all notes off */, 0); } return 1; }
View file
audacious-plugins-2.4.3.tgz/src/amidi-plug/i_backend.c -> audacious-plugins-2.4.4.tgz/src/amidi-plug/i_backend.c
Changed
@@ -20,6 +20,13 @@ #include "i_backend.h" +/* GCC does not like casting func * * to void * *. */ +static void * get_symbol (GModule * mod, const gchar * name) +{ + void * sym = NULL; + g_module_symbol (mod, name, & sym); + return sym; +} gboolean i_str_has_pref_and_suff( const gchar *str , gchar *pref , gchar *suff ) { @@ -55,7 +62,7 @@ else { /* try to get the module name */ - if ( g_module_symbol( module , "backend_info_get" , (gpointer*)&getapmoduleinfo ) ) + if ((getapmoduleinfo = get_symbol (module , "backend_info_get"))) { /* module name found, ok! add its name and filename to the list */ amidiplug_sequencer_backend_name_t * mn = g_malloc(sizeof(amidiplug_sequencer_backend_name_t)); @@ -112,35 +119,38 @@ { gchar * (*getapmoduleinfo)( gchar ** , gchar ** , gchar ** , gint * ); gboolean (*checkautonomousaudio)( void ); - g_module_symbol( backend.gmodule , "backend_init" , (gpointer *)&backend.init ); - g_module_symbol( backend.gmodule , "backend_cleanup" , (gpointer *)&backend.cleanup ); - g_module_symbol( backend.gmodule , "audio_info_get" , (gpointer*)&backend.audio_info_get ); - g_module_symbol( backend.gmodule , "audio_volume_get" , (gpointer *)&backend.audio_volume_get ); - g_module_symbol( backend.gmodule , "audio_volume_set" , (gpointer *)&backend.audio_volume_set ); - g_module_symbol( backend.gmodule , "sequencer_start" , (gpointer *)&backend.seq_start ); - g_module_symbol( backend.gmodule , "sequencer_stop" , (gpointer *)&backend.seq_stop ); - g_module_symbol( backend.gmodule , "sequencer_on" , (gpointer *)&backend.seq_on ); - g_module_symbol( backend.gmodule , "sequencer_off" , (gpointer *)&backend.seq_off ); - g_module_symbol( backend.gmodule , "sequencer_queue_tempo" , (gpointer *)&backend.seq_queue_tempo ); - g_module_symbol( backend.gmodule , "sequencer_queue_start" , (gpointer *)&backend.seq_queue_start ); - g_module_symbol( backend.gmodule , "sequencer_queue_stop" , (gpointer *)&backend.seq_queue_stop ); - g_module_symbol( backend.gmodule , "sequencer_event_init" , (gpointer *)&backend.seq_event_init ); - g_module_symbol( backend.gmodule , "sequencer_event_noteon" , (gpointer *)&backend.seq_event_noteon ); - g_module_symbol( backend.gmodule , "sequencer_event_noteoff" , (gpointer *)&backend.seq_event_noteoff ); - g_module_symbol( backend.gmodule , "sequencer_event_allnoteoff" , (gpointer *)&backend.seq_event_allnoteoff ); - g_module_symbol( backend.gmodule , "sequencer_event_keypress" , (gpointer *)&backend.seq_event_keypress ); - g_module_symbol( backend.gmodule , "sequencer_event_controller" , (gpointer *)&backend.seq_event_controller ); - g_module_symbol( backend.gmodule , "sequencer_event_pgmchange" , (gpointer *)&backend.seq_event_pgmchange ); - g_module_symbol( backend.gmodule , "sequencer_event_chanpress" , (gpointer *)&backend.seq_event_chanpress ); - g_module_symbol( backend.gmodule , "sequencer_event_pitchbend" , (gpointer *)&backend.seq_event_pitchbend ); - g_module_symbol( backend.gmodule , "sequencer_event_sysex" , (gpointer *)&backend.seq_event_sysex ); - g_module_symbol( backend.gmodule , "sequencer_event_tempo" , (gpointer *)&backend.seq_event_tempo ); - g_module_symbol( backend.gmodule , "sequencer_event_other" , (gpointer *)&backend.seq_event_other ); - g_module_symbol( backend.gmodule , "sequencer_output" , (gpointer *)&backend.seq_output ); - g_module_symbol( backend.gmodule , "sequencer_output_shut" , (gpointer *)&backend.seq_output_shut ); - g_module_symbol( backend.gmodule , "sequencer_get_port_count" , (gpointer *)&backend.seq_get_port_count ); - g_module_symbol( backend.gmodule , "backend_info_get" , (gpointer*)&getapmoduleinfo ); - g_module_symbol( backend.gmodule , "audio_check_autonomous" , (gpointer*)&checkautonomousaudio ); + + backend.init = get_symbol (backend.gmodule, "backend_init"); + backend.cleanup = get_symbol (backend.gmodule, "backend_cleanup"); + backend.audio_info_get = get_symbol (backend.gmodule, "audio_info_get"); + backend.audio_volume_get = get_symbol (backend.gmodule, "audio_volume_get"); + backend.audio_volume_set = get_symbol (backend.gmodule, "audio_volume_set"); + backend.seq_start = get_symbol (backend.gmodule, "sequencer_start"); + backend.seq_stop = get_symbol (backend.gmodule, "sequencer_stop"); + backend.seq_on = get_symbol (backend.gmodule, "sequencer_on"); + backend.seq_off = get_symbol (backend.gmodule, "sequencer_off"); + backend.seq_queue_tempo = get_symbol (backend.gmodule, "sequencer_queue_tempo"); + backend.seq_queue_start = get_symbol (backend.gmodule, "sequencer_queue_start"); + backend.seq_queue_stop = get_symbol (backend.gmodule, "sequencer_queue_stop"); + backend.seq_event_init = get_symbol (backend.gmodule, "sequencer_event_init"); + backend.seq_event_noteon = get_symbol (backend.gmodule, "sequencer_event_noteon"); + backend.seq_event_noteoff = get_symbol (backend.gmodule, "sequencer_event_noteoff"); + backend.seq_event_allnoteoff = get_symbol (backend.gmodule, "sequencer_event_allnoteoff"); + backend.seq_event_keypress = get_symbol (backend.gmodule, "sequencer_event_keypress"); + backend.seq_event_controller = get_symbol (backend.gmodule, "sequencer_event_controller"); + backend.seq_event_pgmchange = get_symbol (backend.gmodule, "sequencer_event_pgmchange"); + backend.seq_event_chanpress = get_symbol (backend.gmodule, "sequencer_event_chanpress"); + backend.seq_event_pitchbend = get_symbol (backend.gmodule, "sequencer_event_pitchbend"); + backend.seq_event_sysex = get_symbol (backend.gmodule, "sequencer_event_sysex"); + backend.seq_event_tempo = get_symbol (backend.gmodule, "sequencer_event_tempo"); + backend.seq_event_other = get_symbol (backend.gmodule, "sequencer_event_other"); + backend.seq_output = get_symbol (backend.gmodule, "sequencer_output"); + backend.seq_output_shut = get_symbol (backend.gmodule, "sequencer_output_shut"); + backend.seq_get_port_count = get_symbol (backend.gmodule, "sequencer_get_port_count"); + + getapmoduleinfo = get_symbol (backend.gmodule, "backend_info_get"); + checkautonomousaudio = get_symbol (backend.gmodule, "audio_check_autonomous"); + getapmoduleinfo( &backend.name , NULL , NULL , NULL ); backend.autonomous_audio = checkautonomousaudio(); DEBUGMSG( "backend %s (name '%s') successfully loaded\n" , module_pathfilename , backend.name );
View file
audacious-plugins-2.4.3.tgz/src/amidi-plug/i_configure-alsa.c -> audacious-plugins-2.4.4.tgz/src/amidi-plug/i_configure-alsa.c
Changed
@@ -49,6 +49,13 @@ LISTMIXER_N_COLUMNS }; +/* GCC does not like casting func * * to void * *. */ +static void * get_symbol (GModule * mod, const gchar * name) +{ + void * sym = NULL; + g_module_symbol (mod, name, & sym); + return sym; +} void i_configure_ev_portlv_changetoggle( GtkCellRendererToggle * rdtoggle , gchar * path_str , gpointer data ) @@ -271,10 +278,12 @@ /* it's legit to assume that this can't fail, since the module is present in the backend_list */ alsa_module = g_module_open( alsa_module_pathfilename , 0 ); - g_module_symbol( alsa_module , "sequencer_port_get_list" , (gpointer*)&get_port_list ); - g_module_symbol( alsa_module , "sequencer_port_free_list" , (gpointer*)&free_port_list ); - g_module_symbol( alsa_module , "alsa_card_get_list" , (gpointer*)&get_card_list ); - g_module_symbol( alsa_module , "alsa_card_free_list" , (gpointer*)&free_card_list ); + + get_port_list = get_symbol (alsa_module, "sequencer_port_get_list"); + free_port_list = get_symbol (alsa_module, "sequencer_port_free_list"); + get_card_list = get_symbol (alsa_module, "alsa_card_get_list"); + free_card_list = get_symbol (alsa_module, "alsa_card_free_list"); + /* get an updated list of writable ALSA MIDI ports and ALSA-enabled sound cards*/ wports = get_port_list(); wports_h = wports; scards = get_card_list(); scards_h = scards;
View file
audacious-plugins-2.4.3.tgz/src/amidi-plug/i_midi.c -> audacious-plugins-2.4.4.tgz/src/amidi-plug/i_midi.c
Changed
@@ -158,7 +158,8 @@ last_cmd = cmd; } else { /* running status */ - VFS_UNGETC(c, mf->file_pointer); + if (VFS_UNGETC (c, mf->file_pointer) < 0) + break; mf->file_offset--; cmd = last_cmd; if (!cmd)
View file
audacious-plugins-2.4.3.tgz/src/amidi-plug/i_utils.c -> audacious-plugins-2.4.4.tgz/src/amidi-plug/i_utils.c
Changed
@@ -124,10 +124,10 @@ } if ( parent_win != NULL ) - win = gtk_message_dialog_new( GTK_WINDOW(parent_win) , GTK_DIALOG_DESTROY_WITH_PARENT , - mtype , GTK_BUTTONS_OK , message ); + win = gtk_message_dialog_new ((GtkWindow *) parent_win, + GTK_DIALOG_DESTROY_WITH_PARENT, mtype, GTK_BUTTONS_OK, "%s", message); else - win = gtk_message_dialog_new( NULL , 0 , mtype , GTK_BUTTONS_OK , message ); + win = gtk_message_dialog_new (NULL, 0, mtype, GTK_BUTTONS_OK, "%s", message); gtk_window_set_title( GTK_WINDOW(win) , title ); g_signal_connect_swapped( G_OBJECT(win) , "response" , G_CALLBACK(gtk_widget_destroy) , win );
View file
audacious-plugins-2.4.3.tgz/src/console/Audacious_Driver.cxx -> audacious-plugins-2.4.4.tgz/src/console/Audacious_Driver.cxx
Changed
@@ -283,7 +283,7 @@ { length = tuple_get_int(ti, FIELD_LENGTH, NULL); tuple_free(ti); - playback->set_params(playback, NULL, NULL, fh.m_emu->voice_count() * 1000, sample_rate, 2); + playback->set_params(playback, NULL, 0, fh.m_emu->voice_count() * 1000, sample_rate, 2); } }
View file
audacious-plugins-2.4.3.tgz/src/console/Vfs_File.cxx -> audacious-plugins-2.4.4.tgz/src/console/Vfs_File.cxx
Changed
@@ -21,11 +21,7 @@ long Vfs_File_Reader::size() const { - long pos = tell(); - vfs_fseek( file_, 0, SEEK_END ); - long result = tell(); - vfs_fseek( file_, pos, SEEK_SET ); - return result; + return vfs_fsize (file_); } long Vfs_File_Reader::read_avail( void* p, long s )
View file
audacious-plugins-2.4.3.tgz/src/console/Ym2413_Emu.cxx -> audacious-plugins-2.4.4.tgz/src/console/Ym2413_Emu.cxx
Changed
@@ -2185,7 +2185,7 @@ assert( use_count == 0 ); use_count++; - opll = OPLL_new( clock_rate, sample_rate ); + opll = OPLL_new ((int) clock_rate, (int) sample_rate); if ( !opll ) return 1;
View file
audacious-plugins-2.4.3.tgz/src/console/configure.c -> audacious-plugins-2.4.4.tgz/src/console/configure.c
Changed
@@ -268,9 +268,11 @@ gtk_container_add( GTK_CONTAINER(hbuttonbox) , button_ok ); gtk_box_pack_start( GTK_BOX(configwin_vbox) , hbuttonbox , FALSE , FALSE , 0 ); +#if GTK_CHECK_VERSION (2, 12, 0) gtk_widget_set_tooltip_text( configwin_gen_playback_deflen_spbt , _("The default song length, expressed in seconds, is used for songs " "that do not provide length information (i.e. looping tracks).")); +#endif gtk_widget_show_all( configwin ); }
View file
audacious-plugins-2.4.3.tgz/src/ffaudio/ffaudio-audvfs.c -> audacious-plugins-2.4.4.tgz/src/ffaudio/ffaudio-audvfs.c
Changed
@@ -28,7 +28,11 @@ return vfs_fread(buf, 1, size, file); } -static int audvfs_write(URLContext *h, const unsigned char *buf, int size) +#if CHECK_LIBAVFORMAT_VERSION (52, 68, 0) +static int audvfs_write (URLContext * h, const unsigned char * buf, int size) +#else +static int audvfs_write (URLContext * h, unsigned char * buf, int size) +#endif { VFSFile *file; file = h->priv_data;
View file
audacious-plugins-2.4.3.tgz/src/ffaudio/ffaudio-core.c -> audacious-plugins-2.4.4.tgz/src/ffaudio/ffaudio-core.c
Changed
@@ -47,7 +47,11 @@ av_register_all(); AUDDBG("registering audvfsptr protocol\n"); - av_register_protocol(&audvfsptr_protocol); +#if CHECK_LIBAVFORMAT_VERSION (52, 69, 0) + av_register_protocol2 (& audvfsptr_protocol, sizeof audvfsptr_protocol); +#else + av_register_protocol (& audvfsptr_protocol); +#endif AUDDBG("creating seek mutex/cond\n"); ctrl_mutex = g_mutex_new(); @@ -267,8 +271,8 @@ if (t == NULL) return NULL; - vfs_fseek(fd, 0, SEEK_SET); - tag_tuple_read(t, fd); + if (! vfs_fseek (fd, 0, SEEK_SET)) + tag_tuple_read (t, fd); return t; } @@ -340,8 +344,14 @@ codec_opened = TRUE; /* Determine if audio conversion or resampling is needed */ - in_sample_size = av_get_bits_per_sample_format(c->sample_fmt) / 8; - out_sample_size = av_get_bits_per_sample_format(SAMPLE_FMT_S16) / 8; +#if CHECK_LIBAVCODEC_VERSION (52, 94, 3) + in_sample_size = av_get_bits_per_sample_fmt (c->sample_fmt) / 8; + out_sample_size = av_get_bits_per_sample_fmt (SAMPLE_FMT_S16) / 8; +#else + in_sample_size = av_get_bits_per_sample_format (c->sample_fmt) / 8; + out_sample_size = av_get_bits_per_sample_format (SAMPLE_FMT_S16) / 8; +#endif + chunk_size = out_sample_size * c->channels * (c->sample_rate / 50); switch (c->sample_fmt) {
View file
audacious-plugins-2.4.3.tgz/src/ffaudio/ffaudio-stdinc.h -> audacious-plugins-2.4.4.tgz/src/ffaudio/ffaudio-stdinc.h
Changed
@@ -27,6 +27,14 @@ #include <libavcodec/avcodec.h> #include <libavutil/avutil.h> +#define VERSION_INT(maj, min, mic) ((maj) * 1000000 + (min) * 1000 + (mic)) +#define CHECK_LIBAVCODEC_VERSION(maj, min, mic) (VERSION_INT \ + (LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) \ + >= VERSION_INT (maj, min, mic)) +#define CHECK_LIBAVFORMAT_VERSION(maj, min, mic) (VERSION_INT \ + (LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, \ + LIBAVFORMAT_VERSION_MICRO) >= VERSION_INT (maj, min, mic)) + URLProtocol audvfsptr_protocol; #endif
View file
audacious-plugins-2.4.3.tgz/src/filewriter/flac.c -> audacious-plugins-2.4.4.tgz/src/filewriter/flac.c
Changed
@@ -45,7 +45,8 @@ static FLAC__StreamEncoderWriteStatus flac_write_cb(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer, size_t bytes, unsigned samples, unsigned current_frame, gpointer data) { - vfs_fwrite(buffer, bytes, 1, (VFSFile *) data); + if (vfs_fwrite (buffer, 1, bytes, data) != bytes) + return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; }
View file
audacious-plugins-2.4.3.tgz/src/filewriter/wav.c -> audacious-plugins-2.4.4.tgz/src/filewriter/wav.c
Changed
@@ -36,7 +36,8 @@ .format_required = FMT_S16_LE, }; - +#pragma pack(push) /* must be byte-aligned */ +#pragma pack(1) struct wavhead { guint32 main_chunk; @@ -53,6 +54,8 @@ guint32 data_chunk; guint32 data_length; }; +#pragma pack(pop) + static struct wavhead header; static guint64 written; @@ -75,16 +78,20 @@ header.byte_p_spl = GUINT16_TO_LE((GUINT16_FROM_LE(header.bit_p_spl) / (8 / input.channels))); memcpy(&header.data_chunk, "data", 4); header.data_length = GUINT32_TO_LE(0); - vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); + + if (vfs_fwrite (& header, 1, sizeof header, output_file) != sizeof header) + return 0; written = 0; return 1; } -static void wav_write(void *ptr, gint length) +static void wav_write (void * data, gint len) { - written += vfs_fwrite(ptr, 1, length, output_file); + written += len; + if (vfs_fwrite (data, 1, len, output_file) != len) + fprintf (stderr, "Error while writing to .wav output file.\n"); } static void wav_close(void) @@ -92,9 +99,10 @@ if (output_file) { header.length = GUINT32_TO_LE(written + sizeof (struct wavhead) - 8); - header.data_length = GUINT32_TO_LE(written); - vfs_fseek(output_file, 0, SEEK_SET); - vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); + + if (vfs_fseek (output_file, 0, SEEK_SET) || vfs_fwrite (& header, 1, + sizeof header, output_file) != sizeof header) + fprintf (stderr, "Error while writing to .wav output file.\n"); } }
View file
audacious-plugins-2.4.3.tgz/src/flacng/plugin.c -> audacious-plugins-2.4.4.tgz/src/flacng/plugin.c
Changed
@@ -131,23 +131,11 @@ { AUDDBG("Probe for FLAC.\n"); - gchar *buf = g_new0(gchar, 4); - gboolean flac; - - if (vfs_fseek(fd, 0, SEEK_SET)) - { - g_free(buf); + gchar buf4; + if (vfs_fread (buf, 1, sizeof buf, fd) != sizeof buf) return FALSE; - } - - vfs_fread(buf, 4, 1, fd); - flac = strncmp(buf, "fLaC", 4); - g_free(buf); - if (!flac) - return TRUE; - else - return FALSE; + return ! strncmp (buf, "fLaC", sizeof buf); } static void squeeze_audio(gint32* src, void* dst, guint count, guint res) @@ -563,6 +551,7 @@ return TRUE; } +#ifdef FLAC__METADATA_TYPE_PICTURE static gboolean flac_get_image(const gchar *filename, VFSFile *fd, void **data, gint *length) { AUDDBG("Probe for song image.\n"); @@ -614,6 +603,7 @@ return has_image; } +#endif static const gchar *flac_fmts = { "flac", "fla", NULL }; @@ -630,7 +620,9 @@ .is_our_file_from_vfs = flac_is_our_fd, .vfs_extensions = flac_fmts, .update_song_tuple = flac_update_song_tuple, +#ifdef FLAC__METADATA_TYPE_PICTURE .get_song_image = flac_get_image, +#endif .priority = 1 };
View file
audacious-plugins-2.4.3.tgz/src/gtkui/gtkui_cfg.c -> audacious-plugins-2.4.4.tgz/src/gtkui/gtkui_cfg.c
Changed
@@ -72,7 +72,7 @@ {"player_y", &config.player_y, TRUE}, {"player_width", &config.player_width, TRUE}, {"player_height", &config.player_height, TRUE}, - {"vis_position", (gint *)&config.vis_position, TRUE}, + {"vis_position", & config.vis_position, TRUE}, {"playlist_width", &config.playlist_width, TRUE}, {"playlist_height", &config.playlist_height, TRUE}, };
View file
audacious-plugins-2.4.3.tgz/src/gtkui/gtkui_cfg.h -> audacious-plugins-2.4.4.tgz/src/gtkui/gtkui_cfg.h
Changed
@@ -28,13 +28,13 @@ #define MAINWIN_DEFAULT_POS_X 100 #define MAINWIN_DEFAULT_POS_Y 100 -typedef enum { +enum { VIS_IN_TABS = 0, VIS_ON_LEFT, VIS_ON_RIGHT, VIS_ON_TOP, VIS_ON_BOTTOM -} VisPosition; +}; typedef struct { @@ -44,7 +44,7 @@ gboolean save_window_position; gboolean player_visible; gboolean playlist_visible; - VisPosition vis_position; + gint vis_position; gboolean multi_column_view; gboolean infoarea_visible; gboolean menu_visible;
View file
audacious-plugins-2.4.3.tgz/src/gtkui/ui_gtk.c -> audacious-plugins-2.4.4.tgz/src/gtkui/ui_gtk.c
Changed
@@ -50,7 +50,15 @@ static GtkWidget *label_time; static GtkWidget *slider; + +#if GTK_CHECK_VERSION (2, 12, 0) +#define HAVE_VOLUME static GtkWidget *volume; +static gboolean volume_slider_is_moving = FALSE; +static guint update_volume_timeout_source = 0; +static gulong volume_change_handler_id; +#endif + static GtkWidget *visualizer = NULL; GtkWidget *playlist_box; GtkWidget *window; /* the main window */ @@ -63,11 +71,8 @@ static gulong slider_change_handler_id; static gboolean slider_is_moving = FALSE; -static gboolean volume_slider_is_moving = FALSE; static gint slider_position; static guint update_song_timeout_source = 0; -static guint update_volume_timeout_source = 0; -static gulong volume_change_handler_id; extern GtkWidget *ui_playlist_notebook_tab_title_editing; @@ -423,6 +428,7 @@ return FALSE; } +#ifdef HAVE_VOLUME static gboolean ui_volume_value_changed_cb(GtkButton * button, gdouble volume, gpointer user_data) { aud_drct_set_volume((gint) volume, (gint) volume); @@ -465,6 +471,13 @@ return TRUE; } +void set_volume_diff(gint diff) +{ + gint vol = gtk_scale_button_get_value(GTK_SCALE_BUTTON(volume)); + gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), CLAMP(vol + diff, 0, 100)); +} +#endif + static void set_slider_length (gint length) { if (g_signal_handler_is_connected (slider, slider_change_handler_id)) @@ -533,12 +546,6 @@ return label; } -void set_volume_diff(gint diff) -{ - gint vol = gtk_scale_button_get_value(GTK_SCALE_BUTTON(volume)); - gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), CLAMP(vol + diff, 0, 100)); -} - static gboolean ui_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data) { if (ui_playlist_notebook_tab_title_editing != NULL && @@ -558,6 +565,7 @@ ui_playlist_notebook_edit_tab_title(NULL); break; +#ifdef HAVE_VOLUME case GDK_minus: //FIXME set_volume_diff(-5); break; @@ -565,6 +573,7 @@ case GDK_plus: //FIXME set_volume_diff(5); break; +#endif case GDK_Left: case GDK_KP_Left: @@ -681,8 +690,6 @@ GtkWidget *evbox; GtkAccelGroup *accel; - gint lvol = 0, rvol = 0; /* Left and Right for the volume control */ - gtkui_cfg_load(); multi_column_view = config.multi_column_view; @@ -748,15 +755,18 @@ label_time = gtk_markup_label_new(NULL); gtk_box_pack_start(GTK_BOX(shbox), label_time, FALSE, FALSE, 5); +#ifdef HAVE_VOLUME volume = gtk_volume_button_new(); gtk_button_set_relief(GTK_BUTTON(volume), GTK_RELIEF_NONE); gtk_scale_button_set_adjustment(GTK_SCALE_BUTTON(volume), GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 100, 1, 5, 0))); gtk_widget_set_can_focus(volume, FALSE); /* Set the default volume to the balance average. (I'll add balance control later) -Ryan */ + gint lvol = 0, rvol = 0; aud_drct_get_volume(&lvol, &rvol); gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), (lvol + rvol) / 2); gtk_box_pack_start(GTK_BOX(shbox), volume, FALSE, FALSE, 0); +#endif playlist_box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), playlist_box, TRUE, TRUE, 0); @@ -798,10 +808,12 @@ g_signal_connect(slider, "button-press-event", G_CALLBACK(ui_slider_button_press_cb), NULL); g_signal_connect(slider, "button-release-event", G_CALLBACK(ui_slider_button_release_cb), NULL); +#ifdef HAVE_VOLUME volume_change_handler_id = g_signal_connect(volume, "value-changed", G_CALLBACK(ui_volume_value_changed_cb), NULL); g_signal_connect(volume, "pressed", G_CALLBACK(ui_volume_pressed_cb), NULL); g_signal_connect(volume, "released", G_CALLBACK(ui_volume_released_cb), NULL); update_volume_timeout_source = g_timeout_add(250, (GSourceFunc) ui_volume_slider_update, volume); +#endif g_signal_connect(window, "key-press-event", G_CALLBACK(ui_key_press_cb), NULL); @@ -859,11 +871,13 @@ update_song_timeout_source = 0; } +#ifdef HAVE_VOLUME if (update_volume_timeout_source) { g_source_remove(update_volume_timeout_source); update_volume_timeout_source = 0; } +#endif save_window_size (); gtkui_cfg_save();
View file
audacious-plugins-2.4.3.tgz/src/gtkui/ui_playlist_notebook.c -> audacious-plugins-2.4.4.tgz/src/gtkui/ui_playlist_notebook.c
Changed
@@ -93,6 +93,7 @@ } } +#if GTK_CHECK_VERSION (2, 10, 0) static void tab_reordered(GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer user_data) { GtkTreeView *treeview = playlist_get_treeview_from_page(child); @@ -108,6 +109,7 @@ aud_playlist_reorder(model->playlist, page_num, 1); } +#endif static GtkLabel *get_tab_label(gint playlist) { @@ -201,7 +203,10 @@ gtk_notebook_append_page(UI_PLAYLIST_NOTEBOOK, scrollwin, ebox); gtk_notebook_set_show_tabs(UI_PLAYLIST_NOTEBOOK, index_count(pages) > 1 ? TRUE : FALSE); + +#if GTK_CHECK_VERSION (2, 10, 0) gtk_notebook_set_tab_reorderable(UI_PLAYLIST_NOTEBOOK, scrollwin, TRUE); +#endif if (position >= 0) { @@ -238,8 +243,11 @@ g_signal_connect (UI_PLAYLIST_NOTEBOOK, "switch-page", (GCallback) tab_changed, NULL); + +#if GTK_CHECK_VERSION (2, 10, 0) g_signal_connect (UI_PLAYLIST_NOTEBOOK, "page-reordered", (GCallback) tab_reordered, NULL); +#endif } void ui_playlist_notebook_update(gpointer hook_data, gpointer user_data)
View file
audacious-plugins-2.4.3.tgz/src/gtkui/ui_playlist_widget.c -> audacious-plugins-2.4.4.tgz/src/gtkui/ui_playlist_widget.c
Changed
@@ -33,6 +33,17 @@ #include "ui_playlist_model.h" #include "playlist_util.h" +#if ! GTK_CHECK_VERSION (2, 12, 0) +static void gtk_tree_view_convert_widget_to_bin_window_coords + (GtkTreeView * tree, gint wx, gint wy, gint * bx, gint * by) +{ + gint bx0, by0; + gdk_window_get_position (gtk_tree_view_get_bin_window (tree), & bx0, & by0); + * bx = wx - bx0; + * by = wy - by0; +} +#endif + typedef struct { GtkTreeView * source; @@ -65,9 +76,8 @@ static void _ui_playlist_widget_drag_motion(GtkTreeView * widget, GdkDragContext * context, gint x, gint y, guint time, gpointer user_data) { GdkRectangle win; - GtkAdjustment *vadj; GdkRectangle rect; - gint tx, ty, end_pos, dest_playlist; + gint end_pos, dest_playlist; if (t == NULL) { @@ -91,9 +101,9 @@ end_pos = aud_playlist_entry_count(dest_playlist) - 1; gdk_window_get_geometry(gtk_tree_view_get_bin_window(widget), NULL, NULL, NULL, &win.height, NULL); - gtk_tree_view_convert_widget_to_bin_window_coords(widget, x, y, &tx, &ty); - gtk_tree_view_get_path_at_pos (widget, tx, ty, & t->dest_path, NULL, NULL, + gtk_tree_view_convert_widget_to_bin_window_coords (widget, x, y, & x, & y); + gtk_tree_view_get_path_at_pos (widget, x, y, & t->dest_path, NULL, NULL, NULL); if (! t->dest_path && end_pos != -1) @@ -103,7 +113,7 @@ { gtk_tree_view_get_background_area (widget, t->dest_path, NULL, & rect); - if (ty - rect.y < rect.height / 2) + if (y - rect.y < rect.height / 2) gtk_tree_view_set_drag_dest_row (widget, t->dest_path, GTK_TREE_VIEW_DROP_BEFORE); else @@ -114,11 +124,12 @@ } gtk_tree_view_get_background_area (widget, t->dest_path, NULL, & rect); - vadj = gtk_tree_view_get_vadjustment(widget); + GtkAdjustment * vadj = gtk_tree_view_get_vadjustment (widget); - if (ty >= 0 && ty < rect.height * 2 && vadj->value > 0) + if (y >= 0 && y < rect.height * 2 && vadj->value > 0) gtk_adjustment_set_value(vadj, MAX(0, vadj->value - rect.height)); - else if (win.height - ty <= rect.height * 2 && vadj->value < vadj->upper - vadj->page_size) + else if (win.height - y <= rect.height * 2 && vadj->value < vadj->upper + - vadj->page_size) gtk_adjustment_set_value(vadj, MIN(vadj->upper - vadj->page_size, vadj->value + rect.height)); } } @@ -422,9 +433,7 @@ treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); g_object_unref(model); - gtk_tree_view_set_reorderable(GTK_TREE_VIEW(treeview), TRUE); gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); - gtk_drag_dest_set_track_motion(treeview, TRUE); if (multi_column_view) { @@ -485,7 +494,6 @@ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); - gtk_tree_view_set_rubber_banding(GTK_TREE_VIEW(treeview), FALSE); g_signal_connect (selection, "changed", (GCallback) _ui_playlist_widget_selection_changed, treeview);
View file
audacious-plugins-2.4.3.tgz/src/lyricwiki/lyricwiki.c -> audacious-plugins-2.4.4.tgz/src/lyricwiki/lyricwiki.c
Changed
@@ -120,10 +120,14 @@ g_free(ret); ret = NULL; } + + g_regex_unref(reg); } xmlFree(lyric); } + + xmlFreeDoc(doc); } return ret; @@ -169,6 +173,8 @@ xmlFree(lyric); } } + + xmlFreeDoc(doc); } return uri; @@ -202,6 +208,13 @@ gchar *uri; uri = scrape_uri_from_lyricwiki_search_result(buf, len); + if (uri == NULL) + { + update_lyrics_window(tu, NULL); + mowgli_object_unref(tu); + + return FALSE; + } vfs_async_file_get_contents(uri, (VFSConsumer) get_lyrics_step_3, tu);
View file
audacious-plugins-2.4.3.tgz/src/m3u/m3u.c -> audacious-plugins-2.4.4.tgz/src/m3u/m3u.c
Changed
@@ -43,10 +43,10 @@ static gchar * read_win_text (const gchar * path) { - gchar * raw; + void * raw; gint64 size; - vfs_file_get_contents (path, (void * *) & raw, & size); + vfs_file_get_contents (path, & raw, & size); if (raw == NULL) return NULL;
View file
audacious-plugins-2.4.3.tgz/src/mms/mms.c -> audacious-plugins-2.4.4.tgz/src/mms/mms.c
Changed
@@ -169,10 +169,7 @@ return EOF; } -gint -mms_vfs_fseek_impl(VFSFile * file, - glong offset, - gint whence) +static gint mms_vfs_fseek_impl (VFSFile * file, gint64 offset, gint whence) { return -1; } @@ -183,8 +180,7 @@ return; } -glong -mms_vfs_ftell_impl(VFSFile * file) +static gint64 mms_vfs_ftell_impl (VFSFile * file) { MMSHandle *handle = (MMSHandle *) file->handle; @@ -207,8 +203,7 @@ mmsh_get_length(handle->mmsh)); } -gint -mms_vfs_truncate_impl(VFSFile * file, glong size) +static gint mms_vfs_truncate_impl (VFSFile * file, gint64 size) { return -1; }
View file
audacious-plugins-2.4.3.tgz/src/modplug/archive/arch_raw.cxx -> audacious-plugins-2.4.4.tgz/src/modplug/archive/arch_raw.cxx
Changed
@@ -17,20 +17,29 @@ arch_Raw::arch_Raw(const string& aFileName) { - mFileDesc = vfs_fopen(aFileName.c_str(), "rb"); + mFileDesc = vfs_fopen(aFileName.c_str(), "r"); + if (!mFileDesc) + { + mSize = 0; + return; + } - //open and mmap the file - if(mFileDesc == NULL) + mSize = vfs_fsize(mFileDesc); + if (mSize <= 0) { + vfs_fclose(mFileDesc); mSize = 0; return; } - vfs_fseek(mFileDesc, 0, SEEK_END); - mSize = vfs_ftell(mFileDesc); - vfs_fseek(mFileDesc, 0, SEEK_SET); mMap = malloc(mSize); - vfs_fread(mMap, 1, mSize, mFileDesc); + if (vfs_fread(mMap, 1, mSize, mFileDesc) < mSize) + { + free(mMap); + vfs_fclose(mFileDesc); + mSize = 0; + return; + } } arch_Raw::~arch_Raw()
View file
audacious-plugins-2.4.3.tgz/src/modplug/modplugbmp.cxx -> audacious-plugins-2.4.4.tgz/src/modplug/modplugbmp.cxx
Changed
@@ -104,7 +104,8 @@ const int magicSize = 32; char magicmagicSize; - vfs_fread(magic, 1, magicSize, file); + if (vfs_fread(magic, 1, magicSize, file) < magicSize) + return false; if (!memcmp(magic, UMX_MAGIC, 4)) return true; if (!memcmp(magic, "Extended Module:", 16)) @@ -118,13 +119,17 @@ if (!memcmp(magic, PSM_MAGIC, 4)) return true; - vfs_fseek(file, 44, SEEK_SET); - vfs_fread(magic, 1, 4, file); + if (vfs_fseek(file, 44, SEEK_SET)) + return false; + if (vfs_fread(magic, 1, 4, file) < 4) + return false; if (!memcmp(magic, S3M_MAGIC, 4)) return true; - vfs_fseek(file, 1080, SEEK_SET); - vfs_fread(magic, 1, 4, file); + if (vfs_fseek(file, 1080, SEEK_SET)) + return false; + if (vfs_fread(magic, 1, 4, file) < 4) + return false; // Check for Fast Tracker multichannel modules (xCHN, xxCH) if (magic1 == 'C' && magic2 == 'H' && magic3 == 'N') {
View file
audacious-plugins-2.4.3.tgz/src/mpg123/mpg123.c -> audacious-plugins-2.4.4.tgz/src/mpg123/mpg123.c
Changed
@@ -196,8 +196,8 @@ if (! vfs_is_streaming (file)) { - vfs_fseek (file, 0, SEEK_SET); - tag_tuple_read (tuple, file); + if (! vfs_fseek (file, 0, SEEK_SET)) + tag_tuple_read (tuple, file); } return tuple; @@ -454,8 +454,13 @@ } AUDDBG ("seeking to %d (byte %d)\n", (gint) ctx.seek, (gint) byteoff); + if (vfs_fseek (ctx.fd, byteoff, SEEK_SET)) + { + g_mutex_unlock (ctrl_mutex); + goto decode_cleanup; + } + data->output->flush (ctx.seek); - vfs_fseek(ctx.fd, byteoff, SEEK_SET); ctx.seek = -1; g_cond_signal(ctrl_cond);
View file
audacious-plugins-2.4.3.tgz/src/mtp_up/filetype.c -> audacious-plugins-2.4.4.tgz/src/mtp_up/filetype.c
Changed
@@ -2,84 +2,76 @@ #include "string.h" #include "filetype.h" +typedef struct { + const char *ptype; + const LIBMTP_filetype_t filetype; +} file_entry_t; + +/* This need to be kept constantly updated as new file types arrive. */ +static const file_entry_t file_entries = { + { "wav", LIBMTP_FILETYPE_WAV }, + { "mp3", LIBMTP_FILETYPE_MP3 }, + { "wma", LIBMTP_FILETYPE_WMA }, + { "ogg", LIBMTP_FILETYPE_OGG }, + { "mp4", LIBMTP_FILETYPE_MP4 }, + { "wmv", LIBMTP_FILETYPE_WMV }, + { "avi", LIBMTP_FILETYPE_AVI }, + { "mpeg", LIBMTP_FILETYPE_MPEG }, + { "mpg", LIBMTP_FILETYPE_MPEG }, + { "asf", LIBMTP_FILETYPE_ASF }, + { "qt", LIBMTP_FILETYPE_QT }, + { "mov", LIBMTP_FILETYPE_QT }, + { "wma", LIBMTP_FILETYPE_WMA }, + { "jpg", LIBMTP_FILETYPE_JPEG }, + { "jpeg", LIBMTP_FILETYPE_JPEG }, + { "jfif", LIBMTP_FILETYPE_JFIF }, + { "tif", LIBMTP_FILETYPE_TIFF }, + { "tiff", LIBMTP_FILETYPE_TIFF }, + { "bmp", LIBMTP_FILETYPE_BMP }, + { "gif", LIBMTP_FILETYPE_GIF }, + { "pic", LIBMTP_FILETYPE_PICT }, + { "pict", LIBMTP_FILETYPE_PICT }, + { "png", LIBMTP_FILETYPE_PNG }, + { "wmf", LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT }, + { "ics", LIBMTP_FILETYPE_VCALENDAR2 }, + { "exe", LIBMTP_FILETYPE_WINEXEC }, + { "com", LIBMTP_FILETYPE_WINEXEC }, + { "bat", LIBMTP_FILETYPE_WINEXEC }, + { "dll", LIBMTP_FILETYPE_WINEXEC }, + { "sys", LIBMTP_FILETYPE_WINEXEC }, + { "aac", LIBMTP_FILETYPE_AAC }, + { "mp2", LIBMTP_FILETYPE_MP2 }, + { "flac", LIBMTP_FILETYPE_FLAC }, + { "m4a", LIBMTP_FILETYPE_M4A }, + { "doc", LIBMTP_FILETYPE_DOC }, + { "xml", LIBMTP_FILETYPE_XML }, + { "xls", LIBMTP_FILETYPE_XLS }, + { "ppt", LIBMTP_FILETYPE_PPT }, + { "mht", LIBMTP_FILETYPE_MHT }, + { "jp2", LIBMTP_FILETYPE_JP2 }, + { "jpx", LIBMTP_FILETYPE_JPX } +}; + /* Find the file type based on extension */ LIBMTP_filetype_t find_filetype (const char * filename) { - char *ptype; - ptype = rindex(filename,'.')+1; - LIBMTP_filetype_t filetype; - /* This need to be kept constantly updated as new file types arrive. */ - if (!strcasecmp (ptype, "wav")) { - filetype = LIBMTP_FILETYPE_WAV; - } else if (!strcasecmp (ptype, "mp3")) { - filetype = LIBMTP_FILETYPE_MP3; - } else if (!strcasecmp (ptype, "wma")) { - filetype = LIBMTP_FILETYPE_WMA; - } else if (!strcasecmp (ptype, "ogg")) { - filetype = LIBMTP_FILETYPE_OGG; - } else if (!strcasecmp (ptype, "mp4")) { - filetype = LIBMTP_FILETYPE_MP4; - } else if (!strcasecmp (ptype, "wmv")) { - filetype = LIBMTP_FILETYPE_WMV; - } else if (!strcasecmp (ptype, "avi")) { - filetype = LIBMTP_FILETYPE_AVI; - } else if (!strcasecmp (ptype, "mpeg") || !strcasecmp (ptype, "mpg")) { - filetype = LIBMTP_FILETYPE_MPEG; - } else if (!strcasecmp (ptype, "asf")) { - filetype = LIBMTP_FILETYPE_ASF; - } else if (!strcasecmp (ptype, "qt") || !strcasecmp (ptype, "mov")) { - filetype = LIBMTP_FILETYPE_QT; - } else if (!strcasecmp (ptype, "wma")) { - filetype = LIBMTP_FILETYPE_WMA; - } else if (!strcasecmp (ptype, "jpg") || !strcasecmp (ptype, "jpeg")) { - filetype = LIBMTP_FILETYPE_JPEG; - } else if (!strcasecmp (ptype, "jfif")) { - filetype = LIBMTP_FILETYPE_JFIF; - } else if (!strcasecmp (ptype, "tif") || !strcasecmp (ptype, "tiff")) { - filetype = LIBMTP_FILETYPE_TIFF; - } else if (!strcasecmp (ptype, "bmp")) { - filetype = LIBMTP_FILETYPE_BMP; - } else if (!strcasecmp (ptype, "gif")) { - filetype = LIBMTP_FILETYPE_GIF; - } else if (!strcasecmp (ptype, "pic") || !strcasecmp (ptype, "pict")) { - filetype = LIBMTP_FILETYPE_PICT; - } else if (!strcasecmp (ptype, "png")) { - filetype = LIBMTP_FILETYPE_PNG; - } else if (!strcasecmp (ptype, "wmf")) { - filetype = LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT; - } else if (!strcasecmp (ptype, "ics")) { - filetype = LIBMTP_FILETYPE_VCALENDAR2; - } else if (!strcasecmp (ptype, "exe") || !strcasecmp (ptype, "com") || - !strcasecmp (ptype, "bat") || !strcasecmp (ptype, "dll") || - !strcasecmp (ptype, "sys")) { - filetype = LIBMTP_FILETYPE_WINEXEC; - } else if (!strcasecmp (ptype, "aac")) { - filetype = LIBMTP_FILETYPE_AAC; - } else if (!strcasecmp (ptype, "mp2")) { - filetype = LIBMTP_FILETYPE_MP2; - } else if (!strcasecmp (ptype, "flac")) { - filetype = LIBMTP_FILETYPE_FLAC; - } else if (!strcasecmp (ptype, "m4a")) { - filetype = LIBMTP_FILETYPE_M4A; - } else if (!strcasecmp (ptype, "doc")) { - filetype = LIBMTP_FILETYPE_DOC; - } else if (!strcasecmp (ptype, "xml")) { - filetype = LIBMTP_FILETYPE_XML; - } else if (!strcasecmp (ptype, "xls")) { - filetype = LIBMTP_FILETYPE_XLS; - } else if (!strcasecmp (ptype, "ppt")) { - filetype = LIBMTP_FILETYPE_PPT; - } else if (!strcasecmp (ptype, "mht")) { - filetype = LIBMTP_FILETYPE_MHT; - } else if (!strcasecmp (ptype, "jp2")) { - filetype = LIBMTP_FILETYPE_JP2; - } else if (!strcasecmp (ptype, "jpx")) { - filetype = LIBMTP_FILETYPE_JPX; - } else { - /* Tagging as unknown file type */ - filetype = LIBMTP_FILETYPE_UNKNOWN; - } - return filetype; + char *ptype = strrchr(filename,'.'); + unsigned int n; + + if (ptype != NULL) + { + /* Skip '.' char */ + ptype++; + + /* Seach entry in the table */ + for (n=0; n<sizeof(file_entries)/sizeof(file_entries0); n++) + { + if (!strcasecmp (ptype, file_entriesn.ptype)) + return file_entriesn.filetype; + } + } + + return LIBMTP_FILETYPE_UNKNOWN; }
View file
audacious-plugins-2.4.3.tgz/src/mtp_up/mtp.c -> audacious-plugins-2.4.4.tgz/src/mtp_up/mtp.c
Changed
@@ -316,7 +316,6 @@ aud_menu_plugin_item_add(AUDACIOUS_MENU_MAIN, mtp_root_menuitem); - aud_menu_plugin_item_add(AUDACIOUS_MENU_PLAYLIST_RCLICK, mtp_root_menuitem); g_signal_connect (G_OBJECT (mtp_submenu_item_up), "button_press_event",G_CALLBACK (mtp_press), NULL); g_signal_connect (G_OBJECT (mtp_submenu_item_free), "button_press_event",G_CALLBACK (free_device), NULL); @@ -356,9 +355,6 @@ g_print("The MTP mutex has been unlocked\n"); #endif aud_menu_plugin_item_remove(AUDACIOUS_MENU_MAIN, mtp_root_menuitem); - aud_menu_plugin_item_remove(AUDACIOUS_MENU_PLAYLIST_RCLICK, mtp_root_menuitem); - - gtk_widget_destroy(mtp_submenu_item_up); gtk_widget_destroy(mtp_submenu_item_up); gtk_widget_destroy(mtp_submenu_item_free);
View file
audacious-plugins-2.4.3.tgz/src/notify/libnotify-aosd_osd.c -> audacious-plugins-2.4.4.tgz/src/notify/libnotify-aosd_osd.c
Changed
@@ -22,6 +22,10 @@ #include <libnotify/notify.h> #include "libnotify-aosd_common.h" +#ifndef NOTIFY_CHECK_VERSION +#define NOTIFY_CHECK_VERSION(x,y,z) 0 +#endif + NotifyNotification *notification = NULL; gboolean osd_init() { @@ -55,7 +59,12 @@ GError *error = NULL; if(notification == NULL) { - notification = notify_notification_new(title, message, pb == NULL ? icon : NULL, NULL); + notification = notify_notification_new(title, message, pb == NULL ? icon : NULL +#if NOTIFY_CHECK_VERSION (0, 7, 0) + ); +#else + , NULL); +#endif g_signal_connect(notification, "closed", G_CALLBACK(osd_closed_handler), NULL); AUDDBG("new osd created! (notification=%p)\n", notification); } else {
View file
audacious-plugins-2.4.3.tgz/src/paranormal/libcalc/parser.c -> audacious-plugins-2.4.4.tgz/src/paranormal/libcalc/parser.c
Changed
@@ -1,30 +1,39 @@ -/* A Bison parser, made by GNU Bison 1.875d. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* A Bison parser, made by GNU Bison 2.4.1. */ - This program is free software; you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + 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, or (at your option) - any later version. - + the Free Software Foundation, either version 3 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. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,37 +45,30 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 - - +/* Push parsers. */ +#define YYPUSH 0 -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - NUMBER = 259, - NEG = 260 - }; -#endif -#define NAME 258 -#define NUMBER 259 -#define NEG 260 +/* Pull parsers. */ +#define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ -#line 26 "parser.y" + +/* Line 189 of yacc.c */ +#line 26 "parser.yacc" #include <ctype.h> #include <glib.h> @@ -92,6 +94,9 @@ YYABORT; +/* Line 189 of yacc.c */ +#line 99 "parser.c" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -105,78 +110,230 @@ # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 54 "parser.y" -typedef union YYSTYPE { +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + NAME = 258, + NUMBER = 259, + NEG = 260 + }; +#endif +/* Tokens. */ +#define NAME 258 +#define NUMBER 259 +#define NEG 260 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ +#line 52 "parser.yacc" + char *s_value; char c_value; double d_value; int i_value; + + + +/* Line 214 of yacc.c */ +#line 154 "parser.c" } YYSTYPE; -/* Line 191 of yacc.c. */ -#line 118 "parser.c" +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ +/* Line 264 of yacc.c */ +#line 59 "parser.yacc" + +int yyerror (char * s); +int yylex (YYSTYPE * yylval, void * yyparam); + -/* Line 214 of yacc.c. */ -#line 130 "parser.c" +/* Line 264 of yacc.c */ +#line 172 "parser.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -# ifndef YYFREE -# define YYFREE free +#ifdef YYTYPE_UINT8
View file
audacious-plugins-2.4.3.tgz/src/paranormal/libcalc/parser.yacc -> audacious-plugins-2.4.4.tgz/src/paranormal/libcalc/parser.yacc
Changed
@@ -16,7 +16,7 @@ * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* suppress conflict warnings */ @@ -48,8 +48,6 @@ YYABORT; %} -%pure_parser - /* Data types. */ %union { char *s_value; @@ -58,17 +56,24 @@ int i_value; } -/* Terminal symbols. */ +%{ +int yyerror (char * s); +int yylex (YYSTYPE * yylval, void * yyparam); +%} + +%pure_parser + +/* Terminal symbols. */ %token <s_value> NAME %token <d_value> NUMBER -/* Precedence rules. */ +/* Precedence rules. */ %right '=' %left '-' '+' %left '*' '/' %left NEG %right '^' - + /* Grammar follows */ %% @@ -80,9 +85,9 @@ /* expression_list is a ';' separated list of expressions. */ expression_list: /* empty */ | expression - { } + { } | expression_list ';' - | error ';' + | error ';' { yyerrok; } /* argument list is a comma separated list od expressions */ @@ -93,30 +98,30 @@ | argument_list ',' expression { } - + /* expression is a C-like expression. */ expression: NUMBER - { + { char *buf = g_strdup_printf ("c%f:", $1); - GENERATE (buf); + GENERATE (buf); g_free (buf); } | NAME - { + { char *buf = g_strdup_printf ("l%s:", $1); - GENERATE (buf); + GENERATE (buf); g_free (buf); } | NAME '=' expression - { + { char *buf = g_strdup_printf ("s%s:", $1); - GENERATE (buf); + GENERATE (buf); g_free (buf); } | NAME '(' argument_list ')' { char *buf = g_strdup_printf ("f%s:", $1); - GENERATE (buf); + GENERATE (buf); g_free (buf); } @@ -154,57 +159,63 @@ int yylex (YYSTYPE *yylval, void *yyparam) { int c; parser_control *pc = (parser_control *) yyparam; - + /* Ignore whitespace, get first nonwhite character. */ while ((c = vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n'); - + /* End of input ? */ if (c == EOF) return 0; /* Char starts a number => parse the number. */ if (isdigit (c)) { - vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */ + if (vfs_ungetc (c, pc->input) == EOF) + return 0; + { char *old_locale, *saved_locale; old_locale = setlocale (LC_ALL, NULL); saved_locale = g_strdup (old_locale); setlocale (LC_ALL, "C"); - sscanf (((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value); + sscanf ((gchar *) ((VFSBuffer *)(pc->input->handle))->iter, "%lf", & yylval->d_value); while (isdigit(c) || c == '.') { c = vfs_getc(pc->input); } - vfs_fseek(pc->input, -1, SEEK_CUR); + if (c != EOF && vfs_ungetc (c, pc->input) == EOF) + return 0; setlocale (LC_ALL, saved_locale); g_free (saved_locale); } return NUMBER; } - + /* Char starts an identifier => read the name. */ if (isalpha (c)) { GString *sym_name; sym_name = g_string_new (NULL); - + do { sym_name = g_string_append_c (sym_name, c); /* Get another character. */ c = vfs_getc (pc->input); } while (c != EOF && isalnum (c)); - - vfs_fseek (pc->input, -1, SEEK_CUR); + + if (c != EOF && vfs_ungetc (c, pc->input) == EOF) { + g_string_free (sym_name, FALSE); + return 0; + } yylval->s_value = sym_name->str; - + g_string_free (sym_name, FALSE); - + return NAME; } @@ -227,7 +238,7 @@ return count; } -static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, +static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, char *str) { char op; double dval; @@ -272,7 +283,7 @@ return TRUE; } - + expression_t *expr_compile_string (const char* str, symbol_dict_t *dict) { parser_control pc;
View file
audacious-plugins-2.4.3.tgz/src/pls/util.c -> audacious-plugins-2.4.4.tgz/src/pls/util.c
Changed
@@ -72,9 +72,12 @@ unsigned char x = { 0xff, 0xfe, 0x00 }; g_return_val_if_fail(filename, NULL); - vfs_file_get_contents(filename, (void * *) &buffer, &filesize); - if (buffer == NULL) + + void * vbuf = NULL; + vfs_file_get_contents (filename, & vbuf, & filesize); + if (! vbuf) return NULL; + buffer = vbuf; /* * Convert UTF-16 into something useful. Original implementation
View file
audacious-plugins-2.4.3.tgz/src/psf/eng_psf.c -> audacious-plugins-2.4.4.tgz/src/psf/eng_psf.c
Changed
@@ -134,6 +134,9 @@ } lib_raw_length = tmp_length; + if (lib_raw_file == NULL) + return AO_FAIL; + if (corlett_decode(lib_raw_file, lib_raw_length, &lib_decoded, &lib_len, &lib) != AO_SUCCESS) { free(lib_raw_file);
View file
audacious-plugins-2.4.3.tgz/src/psf/plugin.c -> audacious-plugins-2.4.4.tgz/src/psf/plugin.c
Changed
@@ -96,6 +96,7 @@ return AO_SUCCESS; } +static GStaticMutex mutex = G_STATIC_MUTEX_INIT; static gint seek = 0; gboolean stop_flag = FALSE; @@ -181,10 +182,7 @@ continue; } else - { - data->output->close_audio(); break; - } } f->stop(); @@ -192,15 +190,17 @@ while (!stop_flag && data->output->buffer_playing()) g_usleep(10000); - data->output->close_audio(); - break; } + g_static_mutex_lock (& mutex); + stop_flag = TRUE; + data->output->close_audio (); + g_static_mutex_unlock (& mutex); + g_free(buffer); g_free(path); - stop_flag = TRUE; return ! error; } @@ -232,8 +232,13 @@ void psf2_Stop(InputPlayback *playback) { - stop_flag = TRUE; - playback->output->abort_write(); + g_static_mutex_lock (& mutex); + if (! stop_flag) + { + stop_flag = TRUE; + playback->output->abort_write (); + } + g_static_mutex_unlock (& mutex); } void psf2_pause(InputPlayback *playback, gshort pause) @@ -245,7 +250,8 @@ int psf2_is_our_fd(const gchar *filename, VFSFile *file) { uint8 magic4; - vfs_fread(magic, 1, 4, file); + if (vfs_fread(magic, 1, 4, file) < 4) + return FALSE; return (psf_probe(magic) != ENG_NONE); }
View file
audacious-plugins-2.4.3.tgz/src/pulse_audio/pulse_audio.c -> audacious-plugins-2.4.4.tgz/src/pulse_audio/pulse_audio.c
Changed
@@ -372,6 +372,8 @@ timing->timestamp.tv_sec) * 1000) + (int) ((now.tv_usec - timing->timestamp.tv_usec) / 1000); +#ifdef PA_CHECK_VERSION +#if PA_CHECK_VERSION (0, 9, 11) if (pa_stream_is_corked(stream)) { int delta = time - cached_time; @@ -379,9 +381,11 @@ time = cached_time; else cached_time = time; - } else { - cached_time = time; } + else +#endif +#endif + cached_time = time; fail: pa_threaded_mainloop_unlock(mainloop); @@ -542,12 +546,15 @@ break; #endif +#ifdef PA_SAMPLE_S32LE case FMT_S32_LE: ss.format = PA_SAMPLE_S32LE; break; case FMT_S32_BE: ss.format = PA_SAMPLE_S32BE; break; +#endif + case FMT_FLOAT: ss.format = PA_SAMPLE_FLOAT32NE; break;
View file
audacious-plugins-2.4.3.tgz/src/scrobbler/configure.c -> audacious-plugins-2.4.4.tgz/src/scrobbler/configure.c
Changed
@@ -19,6 +19,10 @@ #include "plugin.h" +#if ! GLIB_CHECK_VERSION (2, 14, 0) +#define g_timeout_add_seconds(s, f, d) g_timeout_add (1000 * (s), (f), (d)) +#endif + GtkWidget *entry1, *entry2, *entry3, *cfgdlg; static GdkColor disabled_color; guint apply_timeout = 0; /* ID of timeout to save new config */
View file
audacious-plugins-2.4.3.tgz/src/scrobbler/plugin.c -> audacious-plugins-2.4.4.tgz/src/scrobbler/plugin.c
Changed
@@ -31,6 +31,10 @@ #include "scrobbler.h" #include "fmt.h" +#if ! GLIB_CHECK_VERSION (2, 14, 0) +#define g_timeout_add_seconds(s, f, d) g_timeout_add (1000 * (s), (f), (d)) +#endif + typedef struct submit_t { int dosubmit, pos_c, len;
View file
audacious-plugins-2.4.3.tgz/src/sid/xs_length.c -> audacious-plugins-2.4.4.tgz/src/sid/xs_length.c
Changed
@@ -1,8 +1,8 @@ -/* +/* XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) Get song length from SLDB for PSID/RSID files - + Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> (C) Copyright 1999-2009 Tecnic Software productions (TNSP) @@ -121,7 +121,7 @@ sscanf(&inLinelinePos, "%2x", &tmpu); tmnode->md5Hashi = tmpu; } - + /* Get playtimes */ if (inLinelinePos != 0) { if (inLinelinePos != '=') { @@ -130,12 +130,12 @@ return NULL; } else { size_t tmpLen, savePos; - + /* First playtime is after '=' */ savePos = ++linePos; tmpLen = strlen(inLine); - - /* Get number of sub-tune lengths */ + + /* Get number of sub-tune lengths */ isOK = TRUE; while ((linePos < tmpLen) && isOK) { xs_findnext(inLine, &linePos); @@ -145,7 +145,7 @@ else isOK = FALSE; } - + /* Allocate memory for lengths */ if (tmnode->nlengths > 0) { tmnode->lengths = (gint *) g_malloc0(tmnode->nlengths * sizeof(gint)); @@ -158,14 +158,14 @@ xs_sldb_node_free(tmnode); return NULL; } - + /* Read lengths in */ i = 0; linePos = savePos; isOK = TRUE; while ((linePos < tmpLen) && (i < tmnode->nlengths) && isOK) { gint l; - + xs_findnext(inLine, &linePos); l = xs_sldb_gettime(inLine, &linePos); @@ -211,7 +211,7 @@ while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) { size_t linePos = 0; lineNum++; - + xs_findnext(inLine, &linePos); /* Check if it is datafield */ @@ -390,7 +390,11 @@ return -1; /* Read PSID header in */ - xs_fread(psidH.magicID, sizeof(psidH.magicID), 1, inFile); + if (xs_fread(psidH.magicID, 1, sizeof psidH.magicID, inFile) < sizeof psidH.magicID) { + xs_fclose(inFile); + return -1; + } + if (strncmp(psidH.magicID, "PSID", 4) && strncmp(psidH.magicID, "RSID", 4)) { xs_fclose(inFile); xs_error("Not a PSID or RSID file '%s'\n", filename); @@ -406,19 +410,17 @@ psidH.startSong = xs_fread_be16(inFile); psidH.speed = xs_fread_be32(inFile); - xs_fread(psidH.sidName, sizeof(gchar), sizeof(psidH.sidName), inFile); - xs_fread(psidH.sidAuthor, sizeof(gchar), sizeof(psidH.sidAuthor), inFile); - xs_fread(psidH.sidCopyright, sizeof(gchar), sizeof(psidH.sidCopyright), inFile); - - if (xs_feof(inFile) || xs_ferror(inFile)) { + if (xs_fread(psidH.sidName, 1, sizeof psidH.sidName, inFile) < sizeof psidH.sidName + || xs_fread(psidH.sidAuthor, 1, sizeof psidH.sidAuthor, inFile) < sizeof psidH.sidAuthor + || xs_fread(psidH.sidCopyright, 1, sizeof psidH.sidCopyright, inFile) < sizeof psidH.sidCopyright) { xs_fclose(inFile); xs_error("Error reading SID file header from '%s'\n", filename); return -4; } - + /* Check if we need to load PSIDv2NG header ... */ psidH2.flags = 0; /* Just silence a stupid gcc warning */ - + if (psidH.version == 2) { /* Yes, we need to */ psidH2.flags = xs_fread_be16(inFile); @@ -507,7 +509,7 @@ key = &keyItem; item = bsearch(&key, db->pindex, db->n, sizeof(db->pindex0), xs_sldb_cmp); - + if (item) return *item; else
View file
audacious-plugins-2.4.3.tgz/src/sid/xs_support.c -> audacious-plugins-2.4.4.tgz/src/sid/xs_support.c
Changed
@@ -1,8 +1,8 @@ -/* +/* XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) Miscellaneous support functions - + Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> (C) Copyright 1999-2007 Tecnic Software productions (TNSP) @@ -23,6 +23,7 @@ #include "xs_support.h" #include <ctype.h> +#define __AUDACIOUS_NEWVFS__ guint16 xs_fread_be16(xs_file_t *f) { @@ -45,7 +46,7 @@ { xs_file_t *f; glong seekPos; - + /* Open file, get file size */ if ((f = xs_fopen(filename, "rb")) == NULL) return -1; @@ -56,7 +57,7 @@ xs_fseek(f, 0L, SEEK_END); seekPos = xs_ftell(f); #endif - + if (seekPos > 0) { size_t readSize = seekPos; if (readSize >= *bufSize || *buf == NULL) { @@ -65,21 +66,24 @@ g_free(*buf); *buf = NULL; } - + *bufSize = seekPos; - + *buf = (guint8 *) g_malloc(*bufSize * sizeof(guint8)); if (*buf == NULL) { xs_fclose(f); return -2; } } - - /* Read data */ - xs_fseek(f, 0, SEEK_SET); - readSize = xs_fread(*buf, sizeof(guint8), *bufSize, f); + + /* Read data */ + if (xs_fseek(f, 0, SEEK_SET)) + readSize = 0; + else + readSize = xs_fread(*buf, 1, *bufSize, f); + xs_fclose(f); - + if (readSize != *bufSize) return -3; else
View file
audacious-plugins-2.4.3.tgz/src/skins/ui_equalizer.c -> audacious-plugins-2.4.4.tgz/src/skins/ui_equalizer.c
Changed
@@ -900,8 +900,7 @@ vfs_fclose(file); } -static void -save_winamp_file(const gchar * filename) +static gboolean save_winamp_file (const gchar * filename) { VFSFile *file; @@ -910,21 +909,31 @@ guchar bands11; if (!(file = open_vfs_file(filename, "wb"))) - return; + return FALSE; - vfs_fwrite("Winamp EQ library file v1.1\x1a!--", 1, 31, file); + if (vfs_fwrite ("Winamp EQ library file v1.1\x1a!--", 1, 31, file) != 31) + goto ERR; memset(name, 0, 257); g_strlcpy(name, "Entry1", 257); - vfs_fwrite(name, 1, 257, file); + + if (vfs_fwrite (name, 1, 257, file) != 257) + goto ERR; for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) bandsi = 63 - (((equalizerwin_get_band(i) + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); bandsAUD_EQUALIZER_NBANDS = 63 - (((equalizerwin_get_preamp() + EQUALIZER_MAX_GAIN) * 63) / EQUALIZER_MAX_GAIN / 2); - vfs_fwrite(bands, 1, 11, file); - vfs_fclose(file); + if (vfs_fwrite (bands, 1, 11, file) != 11) + goto ERR; + + vfs_fclose (file); + return TRUE; + +ERR: + vfs_fclose (file); + return FALSE; } static GtkWidget *
View file
audacious-plugins-2.4.3.tgz/src/skins/ui_skin.c -> audacious-plugins-2.4.4.tgz/src/skins/ui_skin.c
Changed
@@ -31,6 +31,7 @@ /* TODO: enforce default sizes! */ #include <glib.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1469,17 +1470,18 @@ /* the way GTK does things can be very broken. --nenolod */ - gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(), - basename(skin->path)); + gchar pathPATH_MAX; - gchar *troot = g_strdup_printf("%s/.themes", g_get_home_dir()); - g_mkdir_with_parents(troot, 0755); - g_free(troot); + snprintf (path, sizeof path, "%s/.themes", g_get_home_dir ()); + g_mkdir_with_parents (path, 0755); - symlink(skin->path, tmp); - gtk_settings_set_string_property(settings, "gtk-theme-name", - basename(tmp), "audacious"); - g_free(tmp); + snprintf (path, sizeof path, "%s/.themes/aud-%s", g_get_home_dir (), basename + (skin->path)); + if (! g_file_test (path, G_FILE_TEST_EXISTS) && symlink (skin->path, path)) + fprintf (stderr, "Failed to create symlink %s.\n", path); + + gtk_settings_set_string_property (settings, "gtk-theme-name", basename + (path), "audacious"); } /**
View file
audacious-plugins-2.4.3.tgz/src/skins/util.c -> audacious-plugins-2.4.4.tgz/src/skins/util.c
Changed
@@ -454,9 +454,12 @@ unsigned char x = { 0xff, 0xfe, 0x00 }; g_return_val_if_fail(filename, NULL); - vfs_file_get_contents(filename, (void * *) &buffer, &filesize); - if (buffer == NULL) + + void * vbuf = NULL; + vfs_file_get_contents (filename, & vbuf, & filesize); + if (! vbuf) return NULL; + buffer = vbuf; /* * Convert UTF-16 into something useful. Original implementation
View file
audacious-plugins-2.4.3.tgz/src/streambrowser/gui/streambrowser_win.c -> audacious-plugins-2.4.4.tgz/src/streambrowser/gui/streambrowser_win.c
Changed
@@ -298,7 +298,9 @@ gtk_tree_view_set_model(GTK_TREE_VIEW(tree_view), GTK_TREE_MODEL(store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), TRUE); +#if GTK_CHECK_VERSION (2, 10, 0) gtk_tree_view_set_search_entry(GTK_TREE_VIEW(tree_view), GTK_ENTRY(search_entry)); +#endif gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(tree_view), tree_view_search_equal_func, NULL, NULL); gtk_tree_view_set_search_column(GTK_TREE_VIEW(tree_view), 1); g_signal_connect(G_OBJECT(tree_view), "key-press-event", G_CALLBACK(on_tree_view_key_pressed), NULL);
View file
audacious-plugins-2.4.3.tgz/src/streambrowser/xiph.c -> audacious-plugins-2.4.4.tgz/src/streambrowser/xiph.c
Changed
@@ -283,17 +283,21 @@ static gboolean genre_match (gchar * string1, gchar * string2) { - gchar *saveptr = NULL, *token; + gchar **genres = g_strsplit (string1, " ", -1); gboolean matched = FALSE; - gchar *temp1 = g_strdup (string1), *temp2 = g_strdup (string2); + gint n; - token = strtok_r (temp1, " ", &saveptr); - while (token != NULL) + if (genres != NULL) { - if (mystrcasestr (temp2, token)) - matched = TRUE; - - token = strtok_r (NULL, " ", &saveptr); + for (n = 0; genresn != NULL; n++) + { + if (mystrcasestr (string2, genresn)) + { + matched = TRUE; + break; + } + } + g_strfreev (genres); } return matched;
View file
audacious-plugins-2.4.3.tgz/src/vtx/vtx.c -> audacious-plugins-2.4.4.tgz/src/vtx/vtx.c
Changed
@@ -70,8 +70,8 @@ vtx_is_our_fd (const gchar *filename, VFSFile *fp) { char buf2; - - vfs_fread (buf, 2, 1, fp); + if (vfs_fread(buf, 1, 2, fp) < 2) + return FALSE; return (!strncasecmp (buf, "ay", 2) || !strncasecmp (buf, "ym", 2)); }
View file
audacious-plugins-2.4.3.tgz/src/wavpack/wavpack.c -> audacious-plugins-2.4.4.tgz/src/wavpack/wavpack.c
Changed
@@ -345,10 +345,10 @@ AUDDBG("starting probe of %p\n", fd); - vfs_fseek(fd, 0, SEEK_SET); - tu = tuple_new_from_filename(filename); + if (vfs_fseek (fd, 0, SEEK_SET)) + return NULL; - vfs_fseek(fd, 0, SEEK_SET); + tu = tuple_new_from_filename(filename); tag_tuple_read(tu, fd); tuple_associate_int(tu, FIELD_LENGTH, NULL,
View file
audacious-plugins-2.4.3.tgz/src/xsf/plugin.c -> audacious-plugins-2.4.4.tgz/src/xsf/plugin.c
Changed
@@ -248,7 +248,8 @@ gint xsf_is_our_fd(const gchar *filename, VFSFile *file) { gchar magic4; - vfs_fread(magic, 1, 4, file); + if (vfs_fread(magic, 1, 4, file) < 4) + return FALSE; if (!memcmp(magic, "PSF$", 4)) return 1;
View file
audacious-plugins-2.4.3.tgz/src/xsf/vio2sf.c -> audacious-plugins-2.4.4.tgz/src/xsf/vio2sf.c
Changed
@@ -1,3 +1,4 @@ +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -41,7 +42,7 @@ } static int load_map(int issave, unsigned char *udata, unsigned usize) -{ +{ unsigned char *iptr; unsigned isize; unsigned char *xptr; @@ -246,7 +247,7 @@ } else { - if (!load_libs(pwork->level + 1, libbuf, libsize) || !load_psf_one(libbuf, libsize)) + if (!load_libs(pwork->level + 1, libbuf, libsize) || !load_psf_one(libbuf, libsize)) ret = xsf_tagenum_callback_returnvaluebreak; else { @@ -521,7 +522,7 @@ load_getu8 (ARM9Mem.MAIN_MEM, 0x400000); load_getu8 (ARM9Mem.ARM9_REG, 0x10000); load_getu8 (ARM9Mem.ARM9_VMEM, 0x800); - load_getu8 (ARM9Mem.ARM9_OAM, 0x800); + load_getu8 (ARM9Mem.ARM9_OAM, 0x800); load_getu8 (ARM9Mem.ARM9_ABG, 0x80000); load_getu8 (ARM9Mem.ARM9_BBG, 0x20000); load_getu8 (ARM9Mem.ARM9_AOBJ, 0x40000); @@ -574,7 +575,7 @@ sndifwork.pcmbufalloc = malloc(bufferbytes + 3); if (!sndifwork.pcmbufalloc) return -1; - sndifwork.pcmbuftop = sndifwork.pcmbufalloc + ((4 - (((int)sndifwork.pcmbufalloc) & 3)) & 3); + sndifwork.pcmbuftop = (void *) (((uintptr_t) sndifwork.pcmbufalloc + 3) & ~3); sndifwork.bufferbytes = bufferbytes; sndifwork.filled = 0; sndifwork.used = 0; @@ -634,7 +635,7 @@ sndifwork.sync_type = xsf_tagget_int("_vio2sf_sync_type", pfile, bytes, 0); sndifwork.arm9_clockdown_level = xsf_tagget_int("_vio2sf_arm9_clockdown_level", pfile, bytes, clockdown); sndifwork.arm7_clockdown_level = xsf_tagget_int("_vio2sf_arm7_clockdown_level", pfile, bytes, clockdown); - + sndifwork.xfs_load = 0; printf("load_psf... "); if (!load_psf(pfile, bytes))
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.