1. 14 Oct, 2008 2 commits
  2. 09 Oct, 2008 1 commit
  3. 08 Oct, 2008 3 commits
    • Max Kellermann's avatar
      directory: moved code to database.c · 8a50e8a2
      Max Kellermann authored
      Taming the directory.c monster, part II: move the database management
      stuff to database.  directory.c should only contain code which works
      on directory objects.
      8a50e8a2
    • Max Kellermann's avatar
      directory: moved code to update.c · 7b9bed83
      Max Kellermann authored
      The source directory.c mixes several libraries: directory object
      management, database management and database update, resulting in a
      1000+ line monster.  Move the whole database update code to update.c.
      7b9bed83
    • Max Kellermann's avatar
      dirvec: moved code to dirvec.c · 4cfd356e
      Max Kellermann authored
      Having all functions as static (non-inline) functions generates GCC
      warnings, and duplicates binary code across several object files.
      Most of dirvec's methods are too complex for becoming inline
      functions.  Move them all to dirvec.c and publish the prototypes in
      dirvec.h.
      4cfd356e
  4. 06 Oct, 2008 1 commit
    • Eric Wong's avatar
      autotools: tidy up make dist · 016af692
      Eric Wong authored
      * Add missing headers in Makefile.am
      * remove mp4ff.dsp (Win32 crap)
      * Add scripts, m4, bs, autogen.sh to allow for hotfixes by the
        SCM-challenged.  (downloading the source via git is NOT a
        lightweight operation for everybody).
      016af692
  5. 29 Sep, 2008 2 commits
  6. 24 Sep, 2008 3 commits
    • Max Kellermann's avatar
      output: make "struct audio_output" opaque for output plugins · acc4a0ba
      Max Kellermann authored
      We have eliminated direct accesses to the audio_output struct from
      the all output plugins.  Make it opaque for them, and move its real
      declaration to output_internal.h, similar to decoder_internal.h.
      
      Pass the opaque structure to plugin.init() only, which will return the
      plugin's data pointer on success, and NULL on failure.  This data
      pointer will be passed to all other methods instead of the
      audio_output struct.
      acc4a0ba
    • Max Kellermann's avatar
      output: added audio_output_get_name() · 3be5db04
      Max Kellermann authored
      Reduce direct accesses to the audio_output struct from the plugins:
      this time, eliminate all accesses to audio_output.name.  The name is
      required by some plugins for log messages.
      3be5db04
    • Max Kellermann's avatar
      output: one thread per audio output · d32f49a9
      Max Kellermann authored
      To keep I/O nastiness and latencies away from the core, move the audio
      output code to a separate thread, one per output.  The thread is
      created on demand, and currently runs until mpd exits.
      d32f49a9
  7. 23 Sep, 2008 1 commit
    • Eric Wong's avatar
      Replace SongList with struct songvec · 0bec1d38
      Eric Wong authored
      Our linked-list implementation is wasteful and the
      SongList isn't modified enough to benefit from being a linked
      list.  So use a more compact array of song pointers which
      saves ~200K on a library with ~9K songs (on x86-32).
      0bec1d38
  8. 12 Sep, 2008 3 commits
    • Eric Wollesen's avatar
      shout: added mp3 encoder · 5f8eebd1
      Eric Wollesen authored
      [mk: moved this patch after "Refactor and cleanup of shout Ogg and MP3
      audio outputs".  The original commit message follows, although it is
      outdated:]
      
      Creation of shout_mp3 audio output plugin. Basically I just copied the
      existing shout plugin and replaced ogg with lame. Uses lame for mp3
      encoding. Next step is to pull common functionality out of each shout
      plugin and share it between them.
      
      Configuration options for "shout_mp3" are the same as for "shout".
      5f8eebd1
    • Max Kellermann's avatar
      shout: moved code to audioOutput_shout_ogg.c · fcac05a2
      Max Kellermann authored
      Begin dividing audioOutput_shout.c: move everything OGG Vorbis related
      to audioOutput_shout_ogg.c.  The header audioOutput_shout.h has to
      keep its dependency on vorbis/vorbisenc.h, because it needs the vorbis
      encoder types.
      
      For this patch, we have to export several internal functions with
      generic names to the ABI; these will be removed later when the encoder
      plugin patches are merged.
      fcac05a2
    • Max Kellermann's avatar
      shout: moved declarations to audioOutput_shout.h · 7d3ca9c1
      Max Kellermann authored
      Prepare the split of the shout plugin into multiple sources: move
      all important declarations to audioOutput_shout.h.
      7d3ca9c1
  9. 09 Sep, 2008 1 commit
  10. 08 Sep, 2008 3 commits
    • Max Kellermann's avatar
      use strset.h instead of tagTracker.h · f0e64ceb
      Max Kellermann authored
      With a large music database, the linear string collection in
      tagTracker.c becomes very slow.  We implemented that in a
      quick'n'dirty fashion when we removed tree.c, and now we rewrite it
      using the fast hashed string set.
      f0e64ceb
    • Max Kellermann's avatar
      added string set library · 2b8040b4
      Max Kellermann authored
      "struct strset" is a hashed string set: you can add strings to this
      library, and it stores them as a set of unique strings.  You can get
      the size of the set, and you can enumerate through all values.
      
      This will be used to replace the linear tagTracker library.
      2b8040b4
    • Max Kellermann's avatar
      output: static audio_output_plugin list as array · be046b25
      Max Kellermann authored
      Instead of having to register each output plugin, store them
      statically in an array.  This eliminates the need for the List library
      here, and saves some small allocations during startup.
      be046b25
  11. 07 Sep, 2008 5 commits
    • Max Kellermann's avatar
      output: added output_api.h · bed2a49f
      Max Kellermann authored
      Just like decoder_api.h, output_api.h provides the audio output API
      which is used by the plugins.
      bed2a49f
    • Max Kellermann's avatar
      removed fdprintf() and client_print() · 86d261bd
      Max Kellermann authored
      All callers of fdprintf() have been converted to client_printf() or
      fprintf(); it is time to remove this clumsy hack now.  We can also
      remove client_print() which took a file descriptor as parameter.
      86d261bd
    • Max Kellermann's avatar
      tag: added buffered versions of the tag_print.c code · 59efed3e
      Max Kellermann authored
      Currently, when the tag cache is being serialized to hard disk, the
      stdio buffer is flushed before every song, because tag_print.c
      performs unbuffered writes on the raw file descriptor.  Unfortunately,
      the fdprintf() API allows buffered I/O only for a client connection by
      looking up the client pointer owning the file descriptor - for stdio,
      this is not possible.  To re-enable proper stdio buffering, we have to
      duplicate the tag_print.c code without fprintf() instead of our custom
      fdprintf() hack.  Add this duplicated code to tag_save.c.
      59efed3e
    • Max Kellermann's avatar
      song: moved code to song_print.c, song_save.c · 75aa8dad
      Max Kellermann authored
      Move everything which dumps song information (via tag_print.c) to a
      separate source file.  song_print.c gets code which writes song data
      to the client; song_save.c is responsible for serializing songs from
      the tag cache.
      75aa8dad
    • Max Kellermann's avatar
      tag: moved code to tag_print.c · 386c3031
      Max Kellermann authored
      Move everything which dumps a tag to a file descriptor to tag_print.c.
      This relaxes dependencies and splits the code into smaller parts.
      386c3031
  12. 29 Aug, 2008 3 commits
    • Max Kellermann's avatar
      tag: added a pool for tag items · c855415c
      Max Kellermann authored
      The new source tag_pool.c manages a pool of reference counted tag_item
      objects.  This is used to merge tag items of the same type and value,
      saving lots of memory.  Formerly, only the value itself was pooled,
      wasting memory for all the pointers and tag_item structs.
      
      The following results were measured with massif.  Started MPD on
      amd64, typed "mpc", no song being played.  My music database contains
      35k tagged songs.  The results are what massif reports as "peak".
      
       0.13.2:     total 14,131,392; useful 11,408,972; extra 2,722,420
       eric:       total 18,370,696; useful 15,648,182; extra 2,722,514
       mk f34f694e: total 15,833,952; useful 13,111,470; extra 2,722,482
       mk now:     total 12,837,632; useful 10,626,383; extra 2,211,249
      
      This patch set saves 20% memory, and does a good job in reducing heap
      fragmentation.
      c855415c
    • Max Kellermann's avatar
      removed tree.c · b731bbe9
      Max Kellermann authored
      This patch makes MPD consume much more memory because string pooling
      is disabled, but it prepares the next bunch of patches.  Replace the
      code in tagTracker.c with naive algorithms without the tree code.  For
      now, this should do; later we should find better algorithms,
      especially for getNumberOfTagItems(), which has become wasteful with
      temporary memory.
      b731bbe9
    • Max Kellermann's avatar
      tag: moved code to tag_id3.c · 6f72fe3e
      Max Kellermann authored
      The ID3 code uses only the public tag API, but is otherwise
      unrelated.  Move it to a separate source file.
      6f72fe3e
  13. 28 Aug, 2008 2 commits
    • Max Kellermann's avatar
      renamed interface.c to client.c · deb29e08
      Max Kellermann authored
      I don't believe "interface" is a good name for something like
      "connection by a client to MPD", let's call it "client".  This is the
      first patch in the series which changes the name, beginning with the
      file name.
      deb29e08
    • Max Kellermann's avatar
      imported list.h from the Linux kernel sources · 9340e291
      Max Kellermann authored
      linux/list.h is a nice doubly linked list library - it is lightweight
      and powerful at the same time.  It will be useful later, when we begin
      to allocate client structures dynamically.  Import it, and strip out
      all the stuff which we are not going to use.
      9340e291
  14. 26 Aug, 2008 10 commits
    • Max Kellermann's avatar
      renamed player.c to player_control.c · 5e51fa02
      Max Kellermann authored
      Give player.c a better name, meaning that the code is used to control
      the player thread.
      5e51fa02
    • Max Kellermann's avatar
      renamed decode.h to decoder_control.h · 56cdce69
      Max Kellermann authored
      56cdce69
    • Max Kellermann's avatar
      renamed decode.c to decoder_thread.c · dff8c645
      Max Kellermann authored
      It should be obvious in which thread or context a function is being
      executed at runtime.  The code which was left in decode.c is for the
      decoder thread itself; give the file a better name.
      dff8c645
    • Max Kellermann's avatar
      moved global variable "pc" to player.h · 4255bba0
      Max Kellermann authored
      This is the last of the three variables.  Now we don't need
      playerData.h anymore in most sources.
      4255bba0
    • Max Kellermann's avatar
      added decoder_control.c · 8a4970f8
      Max Kellermann authored
      The source "decoder_control.c" provides an API for controlling the
      decoder.  This replaces various direct accesses to the DecoderControl
      struct.
      8a4970f8
    • Max Kellermann's avatar
      moved code to player_thread.c · e8bd9ddc
      Max Kellermann authored
      Move code which runs in the player thread to player_thread.c.  Having
      a lot of player thread code in decode.c isn't easy to understand.
      e8bd9ddc
    • Max Kellermann's avatar
      moved code to crossfade.c · 6104e969
      Max Kellermann authored
      decode.c should be a lot smaller; start by moving all code which
      handles cross-fading to crossfade.c.  Also includes camelCase
      conversion.
      6104e969
    • Max Kellermann's avatar
      renamed inputPlugin.* to decoder_list.* · 41c5fbbb
      Max Kellermann authored
      Since inputPlugin.c manages the list of registered decoders, we should
      rename the source file.
      41c5fbbb
    • Max Kellermann's avatar
      added decoder_initialized() · 2bf7ec4f
      Max Kellermann authored
      decoder_initialized() sets the state to DECODE_STATE_DECODE and wakes
      up the player thread.  It is called by the decoder plugin after its
      internal initialization is finished.  More arguments will be added
      later to prevent direct accesses to the DecoderControl struct.
      2bf7ec4f
    • Max Kellermann's avatar
      added struct decoder · 154aa496
      Max Kellermann authored
      The decoder struct should later be made opaque to the decoder plugin,
      because maintaining a stable struct ABI is quite difficult.  The ABI
      should only consist of a small number of stable functions.
      154aa496