diff options
author | 2010-10-11 19:40:45 +0200 | |
---|---|---|
committer | 2010-10-11 19:40:45 +0200 | |
commit | 582ae572e8171f2eafa631d84016c4803b175557 (patch) | |
tree | 1eaf230b8850f03f516216c14d5fa832b439d5e0 | |
parent | 400616b112752866703d64b47746afe81f834ebb (diff) | |
parent | b04073137b49c47960056f4b8d1a02971bc71b81 (diff) |
Merge branch 'master' into i18n
37 files changed, 439 insertions, 65 deletions
@@ -50,6 +50,7 @@ version 0.4.2 added option to remember current track / position / state on exit, and resume after restart added scrolling support to playlist tabs improved Album Artist field support in many file formats + got rid of STL code in AdPlug and libsidplay2 libraries version 0.4.1 better default/minimal search window size diff --git a/Makefile.am b/Makefile.am index d70f64d1..eb1eb738 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,6 +51,6 @@ docs_DATA = README help.txt about.txt translators.txt ChangeLog\ desktopdir = $(datadir)/applications desktop_DATA = deadbeef.desktop -EXTRA_DIST = $(docs_DATA) $(desktop_DATA) $(INTLTOOL_FILES) +EXTRA_DIST = $(docs_DATA) $(desktop_DATA) $(INTLTOOL_FILES) translation/extra.c ACLOCAL_AMFLAGS = -I m4 @@ -1,5 +1,29 @@ -if you want to build from git - install autotools, and run ./autogen.sh -after doing that, or if you have botstrapped tarball, just run ./configure && make && make install +TABLE OF CONTENTS + +1. compiling, dependencies, etc +2. information for distributors + +========================================================== + +1. compiling, dependencies, etc + +* first you need to install dependencies. full list is provided at the end of this section for your convenience + +* you will need intltool to be installed. if you don't need translations -- run ./configure --disable-nls (in this case you won't need to install intltool) + +* if you want to build from git - install autotools, and run ./autogen.sh to bootstrap + +* if you're compiling from tarball, or have completed previous git step.. + +* after running autogen.sh or unpacking tarball, run "./configure --help", read the output + +* now you're ready to configure the build process -- run "./configure --prefix=/usr", and wait until it finishes. you may want to change prefix to another value. consult INSTALL file for more info. + +* make sure all plugins you need have "Yes" status in the list that's printed by configure. if not -- install missing dependencies. that is especially important for GTKUI, and ALSA or OSS plugins. make sure you have both. otherwise you won't get GUI and/or sound output. + +* after satisfying all dependencies, run "make -j5" (change -j number to suit your number of CPUs/cores, e.g. 5 is quite good for single CPU dual-core machines). it is a good idea to do it as normal user (this step doesn't require root privileges). + +* after build finishes, run "make install" as root full list of dependencies: libsamplerate: REQUIRED dependency, does high quality resampling @@ -22,3 +46,19 @@ full list of dependencies: actual package names for your Linux distribution may vary. +========================================================== + +2. information for distributors + +The Deadbeef player code is licensed under GPLv2, but this is not a requirement for plugins. +Plugins don't link directly to deadbeef code, but are using special API header file which uses ZLib license. +There are several plugins included in this source distribution that have code licensed under MAME and other licenses. +Please inspect following plugins and libraries bundled with them for more info: + * plugins/dumb - uses a modified DUMB 0.9.3 library, which had issues with Debian in the past (but currently seems to be GPL-compliant) + * plugins/ao - uses Audio Overload SDK, which mixes code from many sources, under many licenses, including both GPL and MAME licenses. you might want to check legal status on distibuting linked MAME+GPL code + * plugins/shn - based on xmms-shn code, which has some code under Shorten license (see plugins/shn/LICENSE.shorten (which seems to be compatible with GPL) + +If you know other places in this project, that have licensing issues, but were not mentioned here - please let me know using this email: waker@users.sf.net + +any plugins that impose licensing issues can be safely excluded from build, please see "./configure --help" output for more details +e.g. "./configure --disable-ao" will exclude AOSDK plugin from build @@ -55,6 +55,7 @@ extern "C" { // api version history: // 9.9 -- devel +// 0.8 -- deadbeef-0.4.2 // 0.7 -- deabdeef-0.4.0 // 0.6 -- deadbeef-0.3.3 // 0.5 -- deadbeef-0.3.2 @@ -63,8 +64,8 @@ extern "C" { // 0.2 -- deadbeef-0.2.3 // 0.1 -- deadbeef-0.2.0 -#define DB_API_VERSION_MAJOR 9 -#define DB_API_VERSION_MINOR 9 +#define DB_API_VERSION_MAJOR 0 +#define DB_API_VERSION_MINOR 8 #define DB_PLUGIN_SET_API_VERSION\ .plugin.api_vmajor = DB_API_VERSION_MAJOR,\ diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 219087b3..2f6b518b 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -899,7 +899,7 @@ int32_t mp4ff_meta_find_by_name(const mp4ff_t *f, const char *item, char **value void aac_load_tags (DB_playItem_t *it, mp4ff_t *mp4) { - char *s; + char *s = NULL; for (int i = 0; metainfo[i]; i += 2) { if (mp4ff_meta_find_by_name(mp4, metainfo[i], &s)) { deadbeef->pl_add_meta (it, metainfo[i+1], s); @@ -912,15 +912,19 @@ aac_load_tags (DB_playItem_t *it, mp4ff_t *mp4) { it->replaygain_album_peak = 1; if (mp4ff_meta_find_by_name(mp4, "replaygain_track_gain", &s)) { it->replaygain_track_gain = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_track_peak", &s)) { it->replaygain_track_peak = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_album_gain", &s)) { it->replaygain_album_gain = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_album_peak", &s)) { it->replaygain_album_peak = atof (s); + free (s); } deadbeef->pl_add_meta (it, "title", NULL); } diff --git a/plugins/adplug/adplug-db.cpp b/plugins/adplug/adplug-db.cpp index 86323d45..567d55ca 100644 --- a/plugins/adplug/adplug-db.cpp +++ b/plugins/adplug/adplug-db.cpp @@ -79,7 +79,8 @@ adplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) { info->subsong = it->tracknum; info->decoder->rewind (info->subsong); - info->totalsamples = info->decoder->songlength (info->subsong) / 1000.f * samplerate; + float dur = deadbeef->pl_get_item_duration (it); + info->totalsamples = dur * samplerate; info->currentsample = 0; info->toadd = 0; @@ -247,25 +248,31 @@ adplug_insert (DB_playItem_t *after, const char *fname) { int subsongs = p->getsubsongs (); for (int i = 0; i < subsongs; i++) { // prepare track for addition + float dur = p->songlength (i)/1000.f; + if (dur < 0.1) { + continue; + } DB_playItem_t *it = deadbeef->pl_item_alloc (); it->decoder_id = deadbeef->plug_get_decoder_id (adplug_plugin.plugin.id); it->fname = strdup (fname); it->filetype = adplug_get_extension (fname); it->tracknum = i; - deadbeef->pl_set_item_duration (it, p->songlength (i)/1000.f); + deadbeef->pl_set_item_duration (it, dur); +#if 0 // add metainfo -// if (p->gettitle()[0]) { -// adplug_add_meta (it, "title", p->gettitle()); -// } -// else { -// deadbeef->pl_add_meta (it, "title", NULL); -// } -// if (p->getdesc()[0]) { -// adplug_add_meta (it, "comment", p->getdesc()); -// } -// if (!p->getauthor()[0]) { -// adplug_add_meta (it, "artist", p->getauthor()); -// } + if (p->gettitle()[0]) { + adplug_add_meta (it, "title", p->gettitle()); + } + else { + deadbeef->pl_add_meta (it, "title", NULL); + } + if (p->getdesc()[0]) { + adplug_add_meta (it, "comment", p->getdesc()); + } + if (!p->getauthor()[0]) { + adplug_add_meta (it, "artist", p->getauthor()); + } +#endif deadbeef->pl_add_meta (it, "title", NULL); // insert after = deadbeef->pl_insert_item (after, it); diff --git a/plugins/adplug/adplug/AUTHORS b/plugins/adplug/adplug/AUTHORS new file mode 100644 index 00000000..a4481226 --- /dev/null +++ b/plugins/adplug/adplug/AUTHORS @@ -0,0 +1,89 @@ +AdPlug is copyright (C) 1999 - 2008 Simon Peter <dn.tlp@gmx.net>, et al. +All library code is written by Simon Peter, except the parts listed below. + +Additional Credits: +------------------- +Alexey Yakovenko <waker@users.sourceforge.net>: + - stripped off all STL code + - fixed several memory bugs in ADL format + - Android NDK port + +Phil Hassey <philhassey@hotmail.com>: + - Player development for the following formats: + - MID: MIDI Audio File Format + - CMF: Creative Music File Format + - SCI: Sierra's AdLib Audio File Format + - LAA: LucasArts AdLib Audio File Format + +Marc Winterrowd <remove space and vowels from "marc winterrowd" and append + "at yahoo" plus "dot com">: + - M: Origin Music player development + +Tatsuyuki Satoh <tatuyuki@tky.3web.ne.jp>: + - First YM3812 emulator development + +Ken Silverman <kjs@lems.brown.edu>: + - Second YM3812 emulator development + +Death Adder <death-adder@juno.com>: + - provided many file format specifications + - moral support ;) + +Mamiya <mamiya@users.sourceforge.net>: + - support for .SAT (early Surprise! Adlib Tracker) files + +Akintunde Omitowoju <oplx@yahoo.com>: + - ROL: AdLib Visual Composer player development + +Nikita V. Kalaganov <riven@ok.ru>: + - Player development: + - XAD: shell player and custom module formats + - Protracker loader development: + - SNG: Faust Music Creator + - MAD: Mlat Adlib Tracker + - CFF: BoomTracker 4.0 + - DTM: DeFy Adlib Tracker + - Scream Tracker 3 loader development: + - DMO: Twin TrackPlayer + - XMS-Tracker detection support in AMD loader + +Sjoerd van der Berg <harekiet@zophar.net>: + - DRO: DOSBox Raw OPL player development + +Goetz Waschk <waschk@informatik.uni-rostock.de>: + - Mandrake Linux packages + - Red Hat RPM spec files + +Mike Gorchak <mike@malva.ua>: + - QNX packages + - QNX qpg file + +Tyler Montbriand <tsm@accesscomm.ca>: + - AMD64 (x86_64) fixes + - ROL: Added pitch handling + +Borg Number One [ Borg No. One ] <borg_no.one@gmx.net>: + - Many thanks for the huge amount of work to find the original + author (Andras Molnar) of the LOUDNESS Sound System and managing + to get the sources from him. + +Matthew Gambrell <mgambrell@gmail.com>: + - Enhancements to the DRO (DOSBox Raw OPL) format + - Added dual OPL2 and OPL3 support + +BSPAL <bspal.ys168.com>, +Palxex <palxex@163.com>: + - RIX: Softstar RIX OPL Music Format player development + +Torbjorn Andersson, +Johannes Schickel 'lordhoto' <lordhoto at scummvm dot org>: + - Development of original ADL (Westwood ADL File Format) player in + ScummVM, which has been adapted for AdPlug. + +Adam Nielsen <malvineous@shikadi.net>: + - Fixes for CMF rhythm mode support in original player + - Added entirely new (more accurate) CMF player + - Added surround/harmonic synth + +Dennis Lindroos <lindroos@nls.fi>: + - JBM: JBM Adlib Music format player development diff --git a/plugins/adplug/adplug/README b/plugins/adplug/adplug/README new file mode 100644 index 00000000..e30467f5 --- /dev/null +++ b/plugins/adplug/adplug/README @@ -0,0 +1,91 @@ +this version of AdPlug is not the original work. +it has STL code stripped off, + many bug fixes that are not upstream (yet) +for original AdPlug information see below + +AdPlug - A free AdLib sound player library +Copyright (C) 1999 - 2010 Simon Peter, et al. + +Website: http://adplug.sourceforge.net/ + +Description: +------------ +AdPlug is a free, multi-platform, hardware independent AdLib sound +player library, mainly written in C++. AdPlug plays sound data, +originally created for the AdLib (OPL2/3) audio board, on top of an +OPL2/3 emulator or by using the real hardware. No OPL2/3 chips are +required for playback. + +Supported platforms: +-------------------- +AdPlug currently is tested to compile and run well on the following +platforms and compilers: + +Platform Operating System Compiler +-------- ---------------- -------- +IA32 - x86 Windows XP MinGW 3.4 + MS-DOS 6.22 DJGPP 4.0 + Linux 2.6 GCC 4.1 +x86_64 Linux 2.6 GCC 4.4.2 + +This list only incorporates platforms on which this release of AdPlug has +been tested successfully. This and/or earlier versions of AdPlug may and did +run on a variety of other platforms as well. It just means they haven't been +explicitly tested for this release. + +The library builds as dynamic and/or static link library, depending on +the facilities provided by the host OS. These are autodetected. + +Prerequisites: +-------------- +AdPlug depends upon the following libraries: + +Library: Version: +-------- -------- +libbinio >= 1.4 + +libbinio can be obtained from http://libbinio.sourceforge.net/. + +Installation: +------------- +Please refer to the INSTALL file for installation instructions. + +CVS: +---- +If you checked out from CVS, please first run: + +autoreconf --install + +to generate the build cruft and get the configure script. Oh, and did i +mention you need recent versions of autoconf, automake and libtool? + +When building a CVS version, always supply the --enable-maintainer-mode +option to the configure script! + +Debugging AdPlug: +----------------- +If you feel you have to debug AdPlug, you can compile it with debug logging +support. This is disabled by default. To enable it, you have to define the +DEBUG preprocessor macro. This is done by passing the '--enable-debug' +commandline option to the 'configure' script to enable debugging. + +AdPlug logs to stderr by default. The output can be redirected anytime to a +user specified logfile. This is done by using the 'CAdPlug::debug_output' +method of the 'CAdPlug' class. + +The emulator license issue: +--------------------------- +AdPlug uses MAME's fmopl OPL2 emulator. While this official distribution +includes an old LGPL'd version of the emulator, which was developed by +Tatsuyuki Satoh alone, who relicensed this version under the LGPL, there is +a patch available at: + +http://www.informatik.uni-oldenburg.de/~dyna/adplug/ + +that replaces the old version by the latest version from the MAME source +distribution. The new version features improved emulation quality, but is +licensed under the MAME license, which restricts commercial redistribution. + +The same goes for the OPL3 emulator, which requires the new version of +the OPL2 emulator to build. + + - Simon Peter <dn.tlp@gmx.net> diff --git a/plugins/adplug/adplug/adl.cpp b/plugins/adplug/adplug/adl.cpp index 0ad196e9..6febbf87 100644 --- a/plugins/adplug/adplug/adl.cpp +++ b/plugins/adplug/adplug/adl.cpp @@ -277,11 +277,16 @@ public: // * One for instruments, starting at offset 500. uint8 *getProgram(int progId) { - return _soundData + READ_LE_UINT16(_soundData + 2 * progId); + int offset = READ_LE_UINT16(_soundData + 2 * progId); + return _soundData + offset; } uint8 *getInstrument(int instrumentId) { - return _soundData + READ_LE_UINT16(_soundData + 500 + 2 * instrumentId); + int offset = READ_LE_UINT16(_soundData + 500 + 2 * instrumentId); + if (offset == 0xffff) { + return NULL; + } + return _soundData + offset; } void setupPrograms(); @@ -422,7 +427,7 @@ public: uint8 *_soundData; uint8 _soundIdTable[0x10]; - Channel _channels[10]; + Channel _channels[0xff]; // FIXME: this array must be of size 10, but some files attempt to index >200, so this is a temporary fix to avoid invalid writes uint8 _vibratoAndAMDepthBits; uint8 _rhythmSectionBits; @@ -773,8 +778,19 @@ void AdlibDriver::executePrograms() { opcode &= 0x7F; if (opcode >= _parserOpcodeTableSize) opcode = _parserOpcodeTableSize - 1; - debugC(9, kDebugLevelSound, "Calling opcode '%s' (%d) (channel: %d)", _parserOpcodeTable[opcode].name, opcode, _curChannel); - result = (this->*(_parserOpcodeTable[opcode].function))(dataptr, channel, param); + debugC(9, kDebugLevelSound, "Calling opcode '%s' (%d) (channel: %d)\n", _parserOpcodeTable[opcode].name, opcode, _curChannel); + if (opcode == 2) { + int offset = READ_LE_UINT16(_soundData + 2 * param); + if (offset == 0xffff) { + break; // corrupted file / bad parser + } + else { + result = (this->*(_parserOpcodeTable[opcode].function))(dataptr, channel, param); + } + } + else { + result = (this->*(_parserOpcodeTable[opcode].function))(dataptr, channel, param); + } channel.dataptr = dataptr; if (result) break; @@ -996,6 +1012,9 @@ void AdlibDriver::setupNote(uint8 rawNote, Channel &channel, bool flag) { } void AdlibDriver::setupInstrument(uint8 regOffset, uint8 *dataptr, Channel &channel) { + if (!dataptr) { + return; + } debugC(9, kDebugLevelSound, "setupInstrument(%d, %p, %lu)", regOffset, (const void *)dataptr, (long)(&channel - _channels)); // Amplitude Modulation / Vibrato / Envelope Generator Type / // Keyboard Scaling Rate / Modulator Frequency Multiple @@ -2274,9 +2293,13 @@ void CadlPlayer::playSoundEffect(uint8_t track) { void CadlPlayer::play(uint8_t track) { uint8 soundId = _trackEntries[track]; - if ((int8)soundId == -1 || !_soundDataPtr) + if (soundId == 0xff || !_soundDataPtr) return; soundId &= 0xFF; + int offset = READ_LE_UINT16(_driver->_soundData + 2 * soundId); + if (offset == 0xffff) { + return; + } _driver->callback(16, 0); // while ((_driver->callback(16, 0) & 8)) { // We call the system delay and not the game delay to avoid concurrency issues. @@ -2379,11 +2402,12 @@ bool CadlPlayer::load(const char *filename, const CFileProvider &fp) // _soundFileLoaded = file; // find last subsong - for(int i = 199; i >= 0; i--) - if(_trackEntries[i] != 0xff) { - numsubsongs = i + 1; - break; - } + for(int i = 119; i >= 0; i--) { + if(_trackEntries[i] != 0xff) { + numsubsongs = i + 1; + break; + } + } fp.close(f); cursubsong = 2; @@ -2408,6 +2432,15 @@ unsigned int CadlPlayer::getsubsongs() bool CadlPlayer::update() { + uint8 soundId = _trackEntries[cursubsong]; + if (soundId == 0xff || !_soundDataPtr) { + return false; + } + soundId &= 0xFF; + int offset = READ_LE_UINT16(_driver->_soundData + 2 * soundId); + if (offset == 0xffff) { + return false; + } bool songend = true; // if(_trackEntries[cursubsong] == 0xff) diff --git a/plugins/adplug/adplug/dro.cpp b/plugins/adplug/adplug/dro.cpp index 1d7d5f8e..fdf08e42 100644 --- a/plugins/adplug/adplug/dro.cpp +++ b/plugins/adplug/adplug/dro.cpp @@ -59,9 +59,20 @@ bool CdroPlayer::load(const char *filename, const CFileProvider &fp) // load section mstotal = f->readInt(4); // Total milliseconds in file length = f->readInt(4); // Total data bytes in file - f->ignore(4); // Type of opl data this can contain - ignored data = new unsigned char [length]; - for (i=0;i<length;i++) + + f->ignore(1); // Type of opl data this can contain - ignored + for (i=0;i<3;i++) + data[i]=f->readInt(1); + + if ((data[0] == 0) || (data[1] == 0) || (data[2] == 0)) { + // Some early .DRO files only used one byte for the hardware type, then + // later changed to four bytes with no version number change. If we're + // here then this is a later (more popular) file with the full four bytes + // for the hardware-type. + i = 0; // so ignore the three bytes we just read and start again + } + for (;i<length;i++) data[i]=f->readInt(1); fp.close(f); rewind(0); diff --git a/plugins/adplug/adplug/player.cpp b/plugins/adplug/adplug/player.cpp index 03d26902..71960966 100644 --- a/plugins/adplug/adplug/player.cpp +++ b/plugins/adplug/adplug/player.cpp @@ -32,8 +32,6 @@ const unsigned char CPlayer::op_table[9] = {0x00, 0x01, 0x02, 0x08, 0x09, 0x0a, 0x10, 0x11, 0x12}; CPlayer::CPlayer(Copl *newopl) -// : opl(newopl) - //, db(CAdPlug::database) { opl = newopl; } diff --git a/plugins/ao/eng_dsf/aica.c b/plugins/ao/eng_dsf/aica.c index 09855a04..f504d647 100644 --- a/plugins/ao/eng_dsf/aica.c +++ b/plugins/ao/eng_dsf/aica.c @@ -484,7 +484,6 @@ static void AICA_StopSlot(struct _SLOT *slot,int keyoff) static void AICA_Init(struct _AICA *AICA, const struct AICAinterface *intf) { - printf ("AICA_Init(cpu=%p)\n", intf->cpu); int i=0; AICA->IrqTimA = AICA->IrqTimBC = AICA->IrqMidi = 0; diff --git a/plugins/ao/eng_dsf/arm7.c b/plugins/ao/eng_dsf/arm7.c index 0bc35705..b4314948 100644 --- a/plugins/ao/eng_dsf/arm7.c +++ b/plugins/ao/eng_dsf/arm7.c @@ -44,6 +44,10 @@ struct sARM7* ARM7_Alloc () return cpu; } +void ARM7_Free (struct sARM7 *cpu) { + free (cpu); +} + //-------------------------------------------------------------------------- /** ARM7 emulator init. */ void ARM7_Init (struct sARM7 *cpu) diff --git a/plugins/ao/eng_dsf/arm7.h b/plugins/ao/eng_dsf/arm7.h index 3c9a47db..37f33a3d 100644 --- a/plugins/ao/eng_dsf/arm7.h +++ b/plugins/ao/eng_dsf/arm7.h @@ -130,6 +130,8 @@ struct sARM7 /** ARM7 allocate spu state. */ struct sARM7* ARM7_Alloc (void); +void ARM7_Free (struct sARM7 *cpu); + /** ARM7 emulator init. */ void ARM7_Init (struct sARM7 *cpu); diff --git a/plugins/ao/eng_dsf/eng_dsf.c b/plugins/ao/eng_dsf/eng_dsf.c index b58b6ed4..6cab9509 100644 --- a/plugins/ao/eng_dsf/eng_dsf.c +++ b/plugins/ao/eng_dsf/eng_dsf.c @@ -21,7 +21,7 @@ #include "aica.h" #include "aicadsp.h" -#define DEBUG_LOADER (1) +#define DEBUG_LOADER (0) #define DK_CORE (1) #if DK_CORE @@ -43,7 +43,7 @@ void *dsf_start(const char *path, uint8 *buffer, uint32 length) dsf_synth_t *s = malloc (sizeof (dsf_synth_t)); memset (s, 0, sizeof (dsf_synth_t)); - uint8 *file, *lib_decoded, *lib_raw_file; + uint8 *file = NULL, *lib_decoded = NULL, *lib_raw_file = NULL; uint32 offset, plength, lengthMS, fadeMS; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; @@ -108,6 +108,7 @@ void *dsf_start(const char *path, uint8 *buffer, uint32 length) memcpy(&s->cpu->dc_ram[offset], lib_decoded+4, lib_len-4); // Dispose the corlett structure for the lib - we don't use it + free(lib_decoded); free(lib); } } @@ -234,6 +235,15 @@ int32 dsf_gen(void *handle, int16 *buffer, uint32 samples) int32 dsf_stop(void *handle) { + dsf_synth_t *s = handle; + if (s->cpu) { + dc_hw_free (s->cpu); + ARM7_Free (s->cpu); + } + if (s->c) { + free (s->c); + } + free (s); return AO_SUCCESS; } diff --git a/plugins/ao/eng_psf/eng_psf.c b/plugins/ao/eng_psf/eng_psf.c index 9f68280a..8b12c777 100644 --- a/plugins/ao/eng_psf/eng_psf.c +++ b/plugins/ao/eng_psf/eng_psf.c @@ -69,10 +69,10 @@ void *psf_start(const char *path, uint8 *buffer, uint32 length) psf_synth_t *s = malloc (sizeof (psf_synth_t)); psf_refresh = -1; - uint8 *file, *lib_decoded, *lib_raw_file, *alib_decoded; + uint8 *file = NULL, *lib_decoded = NULL, *lib_raw_file = NULL, *alib_decoded = NULL; uint32 offset, plength, PC, SP, GP, lengthMS, fadeMS; uint64 file_len, lib_len, lib_raw_length, alib_len; - corlett_t *lib; + corlett_t *lib = NULL; int i; union cpuinfo mipsinfo; @@ -140,7 +140,6 @@ void *psf_start(const char *path, uint8 *buffer, uint32 length) strcpy (libpath, s->c->lib); } - trace ("Loading library: %s\n", s->c->lib); if (ao_get_lib(libpath, &lib_raw_file, &tmp_length) != AO_SUCCESS) { psf_stop (s); @@ -207,6 +206,7 @@ void *psf_start(const char *path, uint8 *buffer, uint32 length) // Dispose the corlett structure for the lib - we don't use it free(lib); + lib = NULL; } // now patch the main file into RAM OVER the libraries (but not the aux lib) @@ -242,8 +242,6 @@ void *psf_start(const char *path, uint8 *buffer, uint32 length) strcpy (libpath, s->c->libaux[i]); } - trace ("Loading aux library: %s\n", libpath); - if (ao_get_lib(libpath, &lib_raw_file, &tmp_length) != AO_SUCCESS) { psf_stop (s); @@ -285,11 +283,16 @@ void *psf_start(const char *path, uint8 *buffer, uint32 length) // Dispose the corlett structure for the lib - we don't use it free(lib); + lib = NULL; + free (alib_decoded); + alib_decoded = NULL; } } free(file); -// free(lib_decoded); + file = NULL; + free(lib_decoded); + lib_decoded = NULL; // Finally, set psfby tag strcpy(s->psfby, "n/a"); diff --git a/plugins/ao/eng_psf/eng_psf2.c b/plugins/ao/eng_psf/eng_psf2.c index dd44fdda..de9e5148 100644 --- a/plugins/ao/eng_psf/eng_psf2.c +++ b/plugins/ao/eng_psf/eng_psf2.c @@ -459,13 +459,14 @@ uint32 psf2_load_file(mips_cpu_context *cpu, char *file, uint8 *buf, uint32 bufl void *psf2_start(const char *path, uint8 *buffer, uint32 length) { psf2_synth_t *s = malloc (sizeof (psf2_synth_t)); + memset (s, 0, sizeof (psf2_synth_t)); - uint8 *file, *lib_decoded; + uint8 *file = NULL, *lib_decoded; uint32 irx_len; uint64 file_len, lib_raw_length, lib_len; uint8 *buf; union cpuinfo mipsinfo; - corlett_t *lib; + corlett_t *lib = NULL; loadAddr = 0x23f00; // this value makes allocations work out similarly to how they would // in Highly Experimental (as per Shadow Hearts' hard-coded assumptions) @@ -476,6 +477,10 @@ void *psf2_start(const char *path, uint8 *buffer, uint32 length) free (s); return NULL; } + if (file) { + free (file); + file = NULL; + } if (file_len > 0) printf("ERROR: PSF2 can't have a program section! ps %08x\n", (unsigned int)file_len); @@ -522,7 +527,7 @@ void *psf2_start(const char *path, uint8 *buffer, uint32 length) free (s); return NULL; } - + #if DEBUG_LOADER printf("Lib FS section: size %x bytes\n", lib->res_size); #endif @@ -530,6 +535,8 @@ void *psf2_start(const char *path, uint8 *buffer, uint32 length) num_fs++; filesys[1] = (uint8 *)lib->res_section; fssize[1] = lib->res_size; + free (lib); + lib = NULL; } // dump all files @@ -629,11 +636,15 @@ int32 psf2_stop(void *handle) { psf2_synth_t *s = handle; SPU2close(s->mips_cpu); + SPU2free(s->mips_cpu); if (s->c->lib[0] != 0) { free(s->lib_raw_file); } free(s->c); + if (s->mips_cpu) { + mips_exit (s->mips_cpu); + } free (s); return AO_SUCCESS; diff --git a/plugins/ao/eng_psf/eng_spu.c b/plugins/ao/eng_psf/eng_spu.c index dbda70ac..966fe870 100644 --- a/plugins/ao/eng_psf/eng_spu.c +++ b/plugins/ao/eng_psf/eng_spu.c @@ -263,7 +263,14 @@ int32 spu_gen(void *handle, int16 *buffer, uint32 samples) int32 spu_stop(void *handle) { - free (handle); + spu_synth_t *s = handle; + if (s) { + if (s->mips_cpu) { + SPUclose(s->mips_cpu); + free (s->mips_cpu); + } + free (s); + } return AO_SUCCESS; } diff --git a/plugins/ao/eng_psf/peops2/spu.h b/plugins/ao/eng_psf/peops2/spu.h index 0400e306..e0707178 100644 --- a/plugins/ao/eng_psf/peops2/spu.h +++ b/plugins/ao/eng_psf/peops2/spu.h @@ -102,6 +102,7 @@ typedef struct spu2_state_s { //EXPORT_GCC void CALLBACK SPU2playADPCMchannel(mips_cpu_context *cpu, xa_decode_t *xap); EXPORT_GCC long CALLBACK SPU2init(mips_cpu_context *cpu, void (*callback)(unsigned char *, long, void *), void *data); +EXPORT_GCC void CALLBACK SPU2free(mips_cpu_context *cpu); EXPORT_GCC long CALLBACK SPU2open(mips_cpu_context *cpu, void *pDsp); EXPORT_GCC void CALLBACK SPU2async(mips_cpu_context *cpu, unsigned long cycle); EXPORT_GCC void CALLBACK SPU2close(mips_cpu_context *cpu); diff --git a/plugins/ao/eng_psf/peops2/spu2.c b/plugins/ao/eng_psf/peops2/spu2.c index 5b7ae050..44546170 100644 --- a/plugins/ao/eng_psf/peops2/spu2.c +++ b/plugins/ao/eng_psf/peops2/spu2.c @@ -777,6 +777,13 @@ EXPORT_GCC long CALLBACK SPU2init(mips_cpu_context *cpu, void (*callback)(unsign return 0; } +EXPORT_GCC void CALLBACK SPU2free (mips_cpu_context *cpu) { + if (cpu->spu2) { + free (cpu->spu2); + cpu->spu2 = NULL; + } +} + //////////////////////////////////////////////////////////////////////// // SETUPTIMER: init of certain buffers and threads/timers //////////////////////////////////////////////////////////////////////// diff --git a/plugins/ao/eng_qsf/eng_qsf.c b/plugins/ao/eng_qsf/eng_qsf.c index 32c6c13d..f5bc5c3c 100644 --- a/plugins/ao/eng_qsf/eng_qsf.c +++ b/plugins/ao/eng_qsf/eng_qsf.c @@ -180,7 +180,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) qsf_synth_t *s = malloc (sizeof (qsf_synth_t)); memset (s, 0, sizeof (qsf_synth_t)); - uint8 *file, *lib_decoded, *lib_raw_file; + uint8 *file = NULL, *lib_decoded = NULL, *lib_raw_file = NULL; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; @@ -226,6 +226,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) #endif if (ao_get_lib(libpath, &lib_raw_file, &tmp_length) != AO_SUCCESS) { + free (file); qsf_stop (s); return NULL; } @@ -234,6 +235,7 @@ void *qsf_start(const char *path, uint8 *buffer, uint32 length) if (corlett_decode(lib_raw_file, lib_raw_length, &lib_decoded, &lib_len, &lib) != AO_SUCCESS) { free(lib_raw_file); + free (file); qsf_stop (s); return NULL; } @@ -371,6 +373,9 @@ int32 qsf_stop(void *handle) if (s->qs) { qsound_sh_stop (s->qs); } + if (s->c) { + free (s->c); + } free(s); return AO_SUCCESS; diff --git a/plugins/ao/eng_ssf/eng_ssf.c b/plugins/ao/eng_ssf/eng_ssf.c index 18ba0e42..9b1b5714 100644 --- a/plugins/ao/eng_ssf/eng_ssf.c +++ b/plugins/ao/eng_ssf/eng_ssf.c @@ -295,7 +295,16 @@ int32 ssf_gen(void *handle, int16 *buffer, uint32 samples) int32 ssf_stop(void *handle) { ssf_synth_t *s = handle; - sat_hw_free (s->cpu); + if (s) { + if (s->c) { + free (s->c); + } + if (s->cpu) { + sat_hw_free (s->cpu); + free (s->cpu); + } + free (s); + } return AO_SUCCESS; } diff --git a/plugins/ao/main.c b/plugins/ao/main.c index 2d2c45aa..a3c7bdc4 100644 --- a/plugins/ao/main.c +++ b/plugins/ao/main.c @@ -31,8 +31,8 @@ #include "ao.h" #include "eng_protos.h" -#define trace(...) { fprintf(stderr, __VA_ARGS__); } -//#define trace(fmt,...) +//#define trace(...) { fprintf(stderr, __VA_ARGS__); } +#define trace(fmt,...) /* file types */ static uint32 type; @@ -235,7 +235,6 @@ ao_identify (char *buffer) { void * ao_start (uint32 type, const char *path, uint8 *buffer, uint32 size) { - printf ("ao_start %d %p %d\n", type, buffer, size); return (*types[type].start)(path, buffer, size); } diff --git a/plugins/ao/plugin.c b/plugins/ao/plugin.c index d67e35b0..2e29c4e0 100644 --- a/plugins/ao/plugin.c +++ b/plugins/ao/plugin.c @@ -239,6 +239,7 @@ aoplug_insert (DB_playItem_t *after, const char *fname) { return NULL; } ao_display_info info; + memset (&info, 0, sizeof (info)); int have_info = 0; if (ao_get_info (type, dec, &info) == AO_SUCCESS) { have_info = 1; diff --git a/plugins/ao/readme.txt b/plugins/ao/readme.txt index 26fcbcb1..5f7bd4d8 100644 --- a/plugins/ao/readme.txt +++ b/plugins/ao/readme.txt @@ -1,3 +1,11 @@ +this version of AOSDK is not the original work. +main change is that all engines had been made reentrant to work correctly in deadbeef player + +=== original AOSDK readme starts here === + +it has STL code stripped off, + many bug fixes that are not upstream (yet) +for original AdPlug information see below + Audio Overload SDK - Development Release 1.4.8 February 15, 2009 Copyright (c) 2007-2009 R. Belmont and Richard Bannister. diff --git a/plugins/dca/README b/plugins/dca/README index ac84e8ac..51caf73b 100644 --- a/plugins/dca/README +++ b/plugins/dca/README @@ -1,3 +1,8 @@ +This distribution of libdca is not original work. +All code had been made reentrant to fit deadbeef player needs. + +=== Original libdca README starts here === + About libdca ------------ diff --git a/plugins/dumb/dumb-kode54/readme.txt b/plugins/dumb/dumb-kode54/readme.txt index 7a13df96..7fe98dbf 100644 --- a/plugins/dumb/dumb-kode54/readme.txt +++ b/plugins/dumb/dumb-kode54/readme.txt @@ -1,6 +1,6 @@ NOTICE: this is not the original DUMB-0.9.3,
it is a modified code based on DUMB-0.9.2 fork from http://kode54.foobar2000.org/
-relevant parts of 0.9.3 were merged on top of that
+relevant parts of DUMB-0.9.3 (including new license) had been merged on top of that by Alexey Yakovenko <waker@users.sf.net>
/* _______ ____ __ ___ ___
* \ _ \ \ / \ / \ \ / / ' ' '
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index e44b38f6..f27e403b 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -545,6 +545,7 @@ ffmpeg_insert (DB_playItem_t *after, const char *fname) { // add metainfo ffmpeg_read_metadata_internal (it, fctx); // free decoder + avcodec_close (ctx); av_close_input_file(fctx); // external cuesheet diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index cd06eff3..0280c773 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -702,7 +702,7 @@ on_about1_activate (GtkMenuItem *menuitem, char s[200]; snprintf (s, sizeof (s), _("About DeaDBeeF %s"), VERSION); char fname[PATH_MAX]; - snprintf (fname, sizeof (fname), DOCDIR "/%s", _("about.txt")); + snprintf (fname, sizeof (fname), DOCDIR "/%s", "about.txt"); show_info_window (fname, s, &aboutwindow); } @@ -715,7 +715,7 @@ on_changelog1_activate (GtkMenuItem *menuitem, char s[200]; snprintf (s, sizeof (s), _("DeaDBeeF %s ChangeLog"), VERSION); char fname[PATH_MAX]; - snprintf (fname, sizeof (fname), DOCDIR "/%s", _("ChangeLog")); + snprintf (fname, sizeof (fname), DOCDIR "/%s", "ChangeLog"); show_info_window (fname, s, &changelogwindow); } @@ -726,7 +726,7 @@ on_gpl1_activate (GtkMenuItem *menuitem, gpointer user_data) { char fname[PATH_MAX]; - snprintf (fname, sizeof (fname), DOCDIR "/%s", _("COPYING.GPLv2")); + snprintf (fname, sizeof (fname), DOCDIR "/%s", "COPYING.GPLv2"); show_info_window (fname, "GNU GENERAL PUBLIC LICENSE Version 2", &gplwindow); } @@ -737,7 +737,7 @@ on_lgpl1_activate (GtkMenuItem *menuitem, gpointer user_data) { char fname[PATH_MAX]; - snprintf (fname, sizeof (fname), DOCDIR "/%s", _("COPYING.LGPLv2.1")); + snprintf (fname, sizeof (fname), DOCDIR "/%s", "COPYING.LGPLv2.1"); show_info_window (fname, "GNU LESSER GENERAL PUBLIC LICENSE Version 2.1", &lgplwindow); } @@ -1079,7 +1079,7 @@ on_translators1_activate (GtkMenuItem *menuitem, char s[200]; snprintf (s, sizeof (s), _("DeaDBeeF Translators")); char fname[PATH_MAX]; - snprintf (fname, sizeof (fname), DOCDIR "/%s", _("translators.txt")); + snprintf (fname, sizeof (fname), DOCDIR "/%s", "translators.txt"); show_info_window (fname, s, &translatorswindow); } diff --git a/plugins/shn/README b/plugins/shn/README index 942d8ace..8ff34610 100644 --- a/plugins/shn/README +++ b/plugins/shn/README @@ -1,3 +1,8 @@ +NOTE: this is not original xmms-shn +this code is a port of xmms-shn to deadbeef plugin API + +=== original xmms-shn README starts here === + xmms-shn version 2.4.x diff --git a/plugins/sid/sidplay-libs/README b/plugins/sid/sidplay-libs/README new file mode 100644 index 00000000..6e316678 --- /dev/null +++ b/plugins/sid/sidplay-libs/README @@ -0,0 +1,2 @@ +this is not the original libsidplay2 distribution +please don't use it if you want the original one diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index 90390603..ab1d1ee9 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -275,6 +275,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) { info.ctx = sf_open_virtual (&vfs, SFM_READ, &inf, &info); if (!info.ctx) { trace ("sndfile: sf_open failed"); + deadbeef->fclose (info.file); return NULL; } int totalsamples = inf.frames; diff --git a/plugins/tta/README b/plugins/tta/README index 8b1a1b23..be6f405f 100644 --- a/plugins/tta/README +++ b/plugins/tta/README @@ -1,3 +1,8 @@ +NOTE: this is modified TTA library, not the original one +please don't use it if you need the original one + +=== original TTA README starts here === + TTA Hardware Players Library ============================ diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index db92e223..fc0afe9e 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -418,6 +418,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "title", NULL); after = deadbeef->pl_insert_item (after, it); deadbeef->pl_item_unref (it); + deadbeef->fclose (fp); return after; } ov_callbacks ovcb = { @@ -431,6 +432,8 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { int err = ov_open_callbacks (fp, &vorbis_file, NULL, 0, ovcb); if (err != 0) { trace ("ov_open_callbacks returned %d\n", err); + ov_clear (&vorbis_file); + deadbeef->fclose (fp); return NULL; } diff --git a/plugins/wildmidi/README b/plugins/wildmidi/README index b9f60e5a..d4e7b566 100644 --- a/plugins/wildmidi/README +++ b/plugins/wildmidi/README @@ -1,3 +1,9 @@ +NOTE: this is not the original WildMidi 0.2.0 distribution +it has some bugfixes and improvements by Alexey Yakovenko <waker@users.sf.net> +it doesn't have code from later versions of WildMidi than 0.2.0 + +=== original WildMidi README starts here === + WildMidi v0.2.0 Release Introduction diff --git a/plugins/wildmidi/src/wildmidi_lib.c b/plugins/wildmidi/src/wildmidi_lib.c index 5759ffc5..1096ebe6 100644 --- a/plugins/wildmidi/src/wildmidi_lib.c +++ b/plugins/wildmidi/src/wildmidi_lib.c @@ -3845,6 +3845,11 @@ WildMidi_Close (midi * handle) { } if (mdi->index != NULL) free (mdi->index); + + for (i = 0; i < 4; i++) { + free (mdi->filter.delay[i][0]); + free (mdi->filter.delay[i][1]); + } free (mdi); // no need to unlock cause the struct containing the lock no-longer exists; return 0; @@ -189,7 +189,7 @@ msgstr "Стерео" #: ../plugins/gtkui/gtkui.c:183 #, c-format msgid "| %4d kbps " -msgstr "| %4d Кбит/с " +msgstr "| %4d кбит/с " #: ../plugins/gtkui/gtkui.c:189 msgid "Paused | " @@ -295,7 +295,7 @@ msgstr "Удалить" #: ../plugins/gtkui/interface.c:273 ../plugins/gtkui/deadbeef.glade.h:18 msgid "Crop" -msgstr "Удалить невыделенное" +msgstr "Оставить выделенное" #: ../plugins/gtkui/interface.c:277 ../plugins/gtkui/deadbeef.glade.h:153 msgid "_Find" @@ -364,7 +364,7 @@ msgstr "Не повторять" #: ../plugins/gtkui/interface.c:373 ../plugins/gtkui/deadbeef.glade.h:113 msgid "Scroll follows playback" -msgstr "Прокручивать текущую дорожку" +msgstr "Прокручивать плейлист автоматически" #: ../plugins/gtkui/interface.c:378 ../plugins/gtkui/deadbeef.glade.h:20 msgid "Cursor follows playback" @@ -372,7 +372,7 @@ msgstr "Выделять текущую дорожку" #: ../plugins/gtkui/interface.c:382 ../plugins/gtkui/deadbeef.glade.h:124 msgid "Stop after current" -msgstr "Остановить после текущей" +msgstr "Останавливать после текущей" #: ../plugins/gtkui/interface.c:394 ../plugins/gtkui/deadbeef.glade.h:69 msgid "Jump to current track" @@ -903,7 +903,7 @@ msgid "" "Files will be lost. Proceed?\n" "(This dialog can be turned off in GTKUI plugin settings)" msgstr "" -"Файлы будут утеряны. Продолжить?\n" +"Файлы будут удалены. Продолжить?\n" "(Этот диалог может быть отключён в настройках расширения GTKUI)" #: ../plugins/gtkui/plcommon.c:326 ../plugins/gtkui/trkproperties.c:56 @@ -1295,7 +1295,7 @@ msgstr "Использовать протокол CDDB вместо HTTP" #: ../translation/extra.c:29 msgid "Enable NRG image support" -msgstr "Включить поддержку изображений NRG" +msgstr "Включить поддержку образов NRG" #. DUMB module player plugin #: ../translation/extra.c:31 |