dccp_send.c: Implement chunk queuing for dccp.
[paraslash.git] / mp3dec.c
index 93181ef1421c75879b26156f5ecdbb8103b71f3e..5c6bab339e599152ccbba81d4873500fd8af7e3a 100644 (file)
--- a/mp3dec.c
+++ b/mp3dec.c
@@ -1,19 +1,7 @@
 /*
 /*
- * Copyright (C) 2005-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
  *
  *
- *     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 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file mp3dec.c paraslash's mp3 decoder */
  */
 
 /** \file mp3dec.c paraslash's mp3 decoder */
@@ -74,14 +62,13 @@ next_frame:
        mad_synth_frame(&pmd->synth, &pmd->frame);
 
        for (i = 0; i < pmd->synth.pcm.length; i++) {
        mad_synth_frame(&pmd->synth, &pmd->frame);
 
        for (i = 0; i < pmd->synth.pcm.length; i++) {
-               /* output format: unsigned 16 bit little endian */
-               signed short s = MAD_TO_SHORT(pmd->synth.pcm.samples[0][i]);
-               fn->buf[fn->loaded++] = s & 0xff;
-               fn->buf[fn->loaded++] = s >> 8;
+               int s = MAD_TO_SHORT(pmd->synth.pcm.samples[0][i]);
+               write_int16_host_endian(fn->buf + fn->loaded, s);
+               fn->loaded += 2;
                if (MAD_NCHANNELS(&pmd->frame.header) == 2) { /* stereo */
                        s = MAD_TO_SHORT(pmd->synth.pcm.samples[1][i]);
                if (MAD_NCHANNELS(&pmd->frame.header) == 2) { /* stereo */
                        s = MAD_TO_SHORT(pmd->synth.pcm.samples[1][i]);
-                       fn->buf[fn->loaded++] = s & 0xff;
-                       fn->buf[fn->loaded++] = s >> 8;
+                       write_int16_host_endian(fn->buf + fn->loaded, s);
+                       fn->loaded += 2;
                }
                if (fn->loaded != fn->bufsize) /* output buffer not full */
                        continue;
                }
                if (fn->loaded != fn->bufsize) /* output buffer not full */
                        continue;
@@ -130,6 +117,8 @@ static void mp3dec_open(struct filter_node *fn)
 /**
  * the init function of the mp3dec filter
  *
 /**
  * the init function of the mp3dec filter
  *
+ * \param f pointer to the filter struct to initialize
+ *
  * \sa filter::init
  */
 void mp3dec_init(struct filter *f)
  * \sa filter::init
  */
 void mp3dec_init(struct filter *f)