/* * MPEG Audio header decoder * Copyright (c) 2001, 2002 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
{ int sample_rate, frame_size, mpeg25, padding; int sample_rate_index, bitrate_index; int ret;
ret = ff_mpa_check_header(header); if (ret < 0) return ret;
int ff_mpa_decode_header(uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate, enum AVCodecID *codec_id)
{
MPADecodeHeader s1, *s = &s1;
if (avpriv_mpegaudio_decode_header(s, head) != 0) { return -1;
}
switch(s->layer) { case 1:
*codec_id = AV_CODEC_ID_MP1;
*frame_size = 384; break; case 2:
*codec_id = AV_CODEC_ID_MP2;
*frame_size = 1152; break; default: case 3: if (*codec_id != AV_CODEC_ID_MP3ADU)
*codec_id = AV_CODEC_ID_MP3; if (s->lsf)
*frame_size = 576; else
*frame_size = 1152; break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.