Diffstat (limited to 'core/multimedia/opieplayer/libmad/frame.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmad/frame.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/libmad/frame.c b/core/multimedia/opieplayer/libmad/frame.c index 4ebb80c..bf15e7f 100644 --- a/core/multimedia/opieplayer/libmad/frame.c +++ b/core/multimedia/opieplayer/libmad/frame.c | |||
@@ -1,18 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | * | 18 | * |
@@ -360,33 +360,33 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream) | |||
360 | 360 | ||
361 | /* begin processing */ | 361 | /* begin processing */ |
362 | stream->this_frame = ptr; | 362 | stream->this_frame = ptr; |
363 | stream->next_frame = ptr + 1; /* possibly bogus sync word */ | 363 | stream->next_frame = ptr + 1; /* possibly bogus sync word */ |
364 | 364 | ||
365 | mad_bit_init(&stream->ptr, stream->this_frame); | 365 | mad_bit_init(&stream->ptr, stream->this_frame); |
366 | 366 | ||
367 | if (decode_header(header, stream) == -1) | 367 | if (decode_header(header, stream) == -1) |
368 | goto fail; | 368 | goto fail; |
369 | 369 | ||
370 | /* calculate frame duration */ | 370 | /* calculate frame duration */ |
371 | mad_timer_set(&header->duration, 0, | 371 | mad_timer_set(&header->duration, 0, |
372 | 32 * MAD_NSBSAMPLES(header), header->samplerate); | 372 | 32 * MAD_NSBSAMPLES(header), header->samplerate); |
373 | 373 | ||
374 | /* calculate free bit rate */ | 374 | /* calculate free bit rate */ |
375 | if (header->bitrate == 0) { | 375 | if (header->bitrate == 0) { |
376 | if ((!stream->sync || !stream->freerate) && | 376 | if ((stream->freerate == 0 || !stream->sync) && |
377 | free_bitrate(stream, header) == -1) | 377 | free_bitrate(stream, header) == -1) |
378 | goto fail; | 378 | goto fail; |
379 | 379 | ||
380 | header->bitrate = stream->freerate; | 380 | header->bitrate = stream->freerate; |
381 | header->flags |= MAD_FLAG_FREEFORMAT; | 381 | header->flags |= MAD_FLAG_FREEFORMAT; |
382 | } | 382 | } |
383 | 383 | ||
384 | /* calculate beginning of next frame */ | 384 | /* calculate beginning of next frame */ |
385 | pad_slot = (header->flags & MAD_FLAG_PADDING) ? 1 : 0; | 385 | pad_slot = (header->flags & MAD_FLAG_PADDING) ? 1 : 0; |
386 | 386 | ||
387 | if (header->layer == MAD_LAYER_I) | 387 | if (header->layer == MAD_LAYER_I) |
388 | N = ((12 * header->bitrate / header->samplerate) + pad_slot) * 4; | 388 | N = ((12 * header->bitrate / header->samplerate) + pad_slot) * 4; |
389 | else { | 389 | else { |
390 | unsigned int slots_per_frame; | 390 | unsigned int slots_per_frame; |
391 | 391 | ||
392 | slots_per_frame = (header->layer == MAD_LAYER_III && | 392 | slots_per_frame = (header->layer == MAD_LAYER_III && |