1. 14 Oct, 2008 1 commit
    • Max Kellermann's avatar
      mapper: new song-to-filesystem mapper library · 5b71d5f6
      Max Kellermann authored
      The mapper library maps directory and song objects to file system
      paths.  With this central library, the code mixture in path.c should
      be cleaned up, and we will be able to add neat features like aliasing.
      5b71d5f6
  2. 08 Oct, 2008 4 commits
  3. 29 Sep, 2008 1 commit
  4. 26 Sep, 2008 1 commit
    • Max Kellermann's avatar
      notify: protect notify->pending with the mutex · 58554e14
      Max Kellermann authored
      There was a known deadlocking bug in the notify library: when the
      other thread set notify->pending after the according check in
      notify_wait(), the latter thread was deadlocked.  Resolve this by
      synchronizing all accesses to notify->pending with the notify object's
      mutex.  Since notify_signal_sync() was never used, we can remove it.
      As a consequence, we don't need notify_enter() and notify_leave()
      anymore; eliminate them, too.
      58554e14
  5. 26 Aug, 2008 26 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
      a2b24462
    • 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 flag "decoder.seeking" · 1c196478
      Max Kellermann authored
      This flag is used internally; it is set by decoder_seek_where(), and
      indicates that the decoder plugin has begun the seek process.  It is
      used for the case that the decoder plugin has to read data during the
      seek process.  Before this patch, that was impossible, because
      decoder_read() would refuse to read data unless dc->command is NONE.
      This patch is kind of a dirty workaround, and needs to be redesigned
      later.
      1c196478
    • Max Kellermann's avatar
      added InputStream.ready · 82ca4cf8
      Max Kellermann authored
      The flag "ready" indicates whether the input stream is ready and it
      has parsed all meta data.  Previously, it was impossible for
      decodeStart() to see the content type of HTTP input streams, because
      at that time, the HTTP response wasn't parsed yet.
      82ca4cf8
    • 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
      added inline function audio_format_time_to_size() · 2650b9eb
      Max Kellermann authored
      Make the code more readable by hiding big formulas in an inline
      function with a nice name.
      2650b9eb
    • Max Kellermann's avatar
      pass max_chunks to calculateCrossFadeChunks() · 0aedf7dd
      Max Kellermann authored
      Make calculateCrossFadeChunks() more generic and portable by
      eliminating global variable access.
      0aedf7dd
    • Max Kellermann's avatar
      renamed functions in decoder_list.h · e754ed01
      Max Kellermann authored
      InputPlugin to decoder_plugin, and no camelCase.
      e754ed01
    • Max Kellermann's avatar
      no camel case in struct decoder_plugin · 772d3da9
      Max Kellermann authored
      772d3da9
    • Max Kellermann's avatar
      renamed InputPlugin to struct decoder_plugin · e41be362
      Max Kellermann authored
      "decoder plugin" is a better name than "input plugin", since the
      plugin does not actually do the input - InputStream does.  Also don't
      use typedef, so we can forward-declare it if required.
      e41be362
    • Max Kellermann's avatar
      added PlayerControl.command · efde884a
      Max Kellermann authored
      PlayerControl.command replaces the old attributes play, stop, pause,
      closeAudio, lockQueue, unlockQueue, seek.  The main thread waits for
      each command synchronously, so there can only be one command enabled
      at a time anyway.
      efde884a
    • Max Kellermann's avatar
      added decoder_command_finished() to decoder_api.h · 78c55e24
      Max Kellermann authored
      Some decoder commands are implemented in the decoder plugins, thus
      they need to have an API call to signal that their current command has
      been finished.  Let them use the new decoder_command_finished()
      instead of the internal dc_command_finished().
      78c55e24
    • Max Kellermann's avatar
      moved struct AudioFormat to audio_format.h · 1b845f94
      Max Kellermann authored
      We want to expose the AudioFormat structure to plugins; remove some
      clutter by moving its declaration to a separate header file.
      1b845f94
    • Max Kellermann's avatar
      do not sleep after openAudioDevice() · 4f80f53c
      Max Kellermann authored
      After the decoder has been initialized and the audio device has been
      opened, don't sleep.  The decoder plugin won't do anything special nor
      will it care to wake us up for some reason.
      4f80f53c
    • 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
    • Max Kellermann's avatar
      invoke the notify API directly · 241cd043
      Max Kellermann authored
      Don't use wrappers like player_wakeup_decoder_nb().  These have been
      wrappers calling notify.c functions, for compatibility with the
      existing code when we migrated to notify.c.
      241cd043
    • Max Kellermann's avatar
      removed "else" · 87beded4
      Max Kellermann authored
      The "if" block breaked out of the loop.  That means we can move the
      code out of the "else" block.
      87beded4
    • Max Kellermann's avatar
      added dc_command_finished() · 9e0f7dcd
      Max Kellermann authored
      dc_command_finished() is invoked by the decoder thread when it has
      finished a command (sent by the player thread).  It resets dc.command
      and wakes up the player thread.  This combination was used at a lot of
      places, and by introducing this function, the code will be more
      readable.
      9e0f7dcd
    • Max Kellermann's avatar
      don't busy wait for the decoder thread · 726c6e86
      Max Kellermann authored
      Busy wait loops are a bad thing, especially when the response time can
      be very long - busy waits eat a lot of CPU, and thus slow down the
      other thread.  Since the other thread will notify us when it's ready,
      we can use notify_wait() instead.
      726c6e86
    • Max Kellermann's avatar
      merged start, stop, seek into DecoderControl.command · 8d3942e0
      Max Kellermann authored
      Much of the existing code queries all three variables sequentially.
      Since only one of them can be set at a time, this can be optimized and
      unified by merging all of them into one enum variable.  Later, the
      "command" checks can be expressed in a "switch" statement.
      8d3942e0
    • Max Kellermann's avatar
      don't set pc->errored_song in decodeStart() · 180d78a8
      Max Kellermann authored
      pc->errored_song is already set by decodeParent() in the player thread
      when we set dc->error; no need to set it in the decoder thread.
      180d78a8
    • Max Kellermann's avatar
      added dc.next_song, renamed pc.current_song · d507ff28
      Max Kellermann authored
      Since pc->current_song denotes the song which the decoder should use
      next, we should move it to DecoderControl.  This removes one internal
      PlayerControl struct access from the decoder code.
      
      Also add pc.next_song, which is manipulated by the playlist code, and
      gets copied to dc.next_song as soon as the decoder is started.
      d507ff28
  6. 01 Jun, 2008 3 commits
  7. 15 Apr, 2008 3 commits
  8. 14 Apr, 2008 1 commit