1. 10 Oct, 2008 3 commits
    • Max Kellermann's avatar
      mp3: dither an arbitrary number of channels · f41fe1e0
      Max Kellermann authored
      The mp3 plugin did not use the MAD_NCHANNELS() value correctly: when a
      stream was not stereo, it was assumed to be mono, although the correct
      number was passed to MPD.  libmad doesn't support more than 2
      channels, but this change allows gcc to optimize its inlining
      strategy.
      f41fe1e0
    • Max Kellermann's avatar
      mp3: hard-code dithering to 16 bits · bac13660
      Max Kellermann authored
      The dithering function audio_linear_dither() worked for signed 16 bits
      only anyway, having a variable "bits" just disables important gcc
      optimizations.
      bac13660
    • Max Kellermann's avatar
      audio_format: renamed sampleRate to sample_rate · de2cb3f3
      Max Kellermann authored
      The last bit of CamelCase in audio_format.h.  Additionally, rename a
      bunch of local variables.
      de2cb3f3
  2. 08 Oct, 2008 2 commits
  3. 29 Sep, 2008 4 commits
    • Max Kellermann's avatar
      use C99 struct initializers · de7cda1d
      Max Kellermann authored
      The old struct initializers are error prone and don't allow moving
      elements around.  Since we are going to overhaul some of the APIs
      soon, it's easier to have all implementations use C99 initializers.
      de7cda1d
    • Max Kellermann's avatar
      decoder: renamed plugin methods · 21d3d300
      Max Kellermann authored
      Why have a "_func" prefix on all method names?  Also don't typedef the
      methods, there is no advantage in that.
      21d3d300
    • Max Kellermann's avatar
      switch to C99 types, part II · 226d52b3
      Max Kellermann authored
      Do full C99 integer type conversion in all modules which were not
      touched by Eric's merged patch.
      226d52b3
    • Eric Wong's avatar
      Switch to C99 types (retaining compat with old compilers) · 0352766d
      Eric Wong authored
      Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the
      mind needs to retrain itself to skip over the first 4 tokens of
      a type to get to its meaning.  So avoid having extra characters
      on my terminal to make it easier to follow code at 2:30 am in
      the morning.
      
      Please report any new issues you may come across on Free
      toolchains.  I realize how difficult it can be to build/maintain
      cross-compiling toolchains and I have no intention of forcing
      people to upgrade their toolchains to build mpd.
      
      Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
      0352766d
  4. 23 Sep, 2008 11 commits
  5. 17 Sep, 2008 1 commit
    • Max Kellermann's avatar
      mp3: fix buffer overflow when max_frames is too large · 913028a7
      Max Kellermann authored
      The function decodeFirstFrame() allocates memory based on data from
      the mp3 header.  This can make the buffer size allocation overflow, or
      lead to a DoS attack with a very large buffer.  Cap this buffer at 8
      million frames, which should really be enough for reasonable files.
      913028a7
  6. 12 Sep, 2008 1 commit
    • Terry's avatar
      mp4: fix potential integer overflow bug in the mp4_decode() function · 79a14c9a
      Terry authored
      A crafted mp4 file could cause an integer overflow in mp4_decode
      function in src/inputPlugins/mp4_plugin.c.  mp4ff_num_samples()
      function returns some tainted value. sizeof(float) * numSamples is an
      integer overflow operation if numSamples is too huge, so xmalloc will
      allocate a small memory region.  I constructe a mp4 file, and use
      faad2 to open the file. mp4ff_num_samples() returns -1. So I think mpd
      bears from the same problem.
      79a14c9a
  7. 07 Sep, 2008 2 commits
    • Max Kellermann's avatar
      audio_format: converted typedef AudioFormat to struct audio_format · f1dd9c20
      Max Kellermann authored
      Get rid of CamelCase, and don't use a typedef, so we can
      forward-declare it, and unclutter the include dependencies.
      f1dd9c20
    • Max Kellermann's avatar
      fix -Wcast-qual -Wwrite-strings warnings · 4dd9d4b2
      Max Kellermann authored
      The previous patch enabled these warnings.  In Eric's branch, they
      were worked around with a generic deconst_ptr() function.  There are
      several places where we can add "const" to pointers, and in others,
      libraries want non-const strings.  In the latter, convert string
      literals to "static char[]" variables - this takes the same space, and
      seems safer than deconsting a string literal.
      4dd9d4b2
  8. 29 Aug, 2008 5 commits
  9. 26 Aug, 2008 11 commits