X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3dec.c;h=335c2baaea66f2ac6b9392b177958101fc36b0e2;hp=93181ef1421c75879b26156f5ecdbb8103b71f3e;hb=33713473b1051c2d9f487c66a92a5cbdf1277ce3;hpb=cb975a0978aec84c4710037ddb407737d455d1d4 diff --git a/mp3dec.c b/mp3dec.c index 93181ef1..335c2baa 100644 --- a/mp3dec.c +++ b/mp3dec.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andre Noll + * Copyright (C) 2005-2007 Andre Noll * * 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 @@ -74,14 +74,13 @@ next_frame: 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]); - 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; @@ -130,6 +129,8 @@ static void mp3dec_open(struct filter_node *fn) /** * 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)