1 /*
2 * MPEG Audio parser
3 * Copyright (c) 2003 Fabrice Bellard
4 * Copyright (c) 2003 Michael Niedermayer
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
28
36
37 #define MPA_HEADER_SIZE 4
38
39 /* header + layer + freq + lsf/mpeg25 */
40 #define SAME_HEADER_MASK \
41 (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))
42
45 const uint8_t **poutbuf, int *poutbuf_size,
46 const uint8_t *buf, int buf_size)
47 {
53 int flush = !buf_size;
54
55 for(
i=0;
i<buf_size; ){
61
64 break;
65 }
66 }else{
70
72
77 } else {
83 s->frame_size =
ret-4;
84
85 if (
s->header_count > header_threshold) {
93 avctx->
bit_rate += (bit_rate - avctx->
bit_rate) / (
s->header_count - header_threshold);
94 }
95 }
96
99 next = buf_size;
102 "MP3ADU full parser");
104 *poutbuf_size = 0;
105 return buf_size; /* parsers must not return error codes */
106 }
107
108 break;
109 }
110 }
111 }
112 }
113
117 *poutbuf_size = 0;
118 return buf_size;
119 }
120
123 *poutbuf_size = 0;
124 return next;
125 }
126
129 *poutbuf_size = 0;
130 return next;
131 }
132
133 *poutbuf = buf;
134 *poutbuf_size = buf_size;
135 return next;
136 }
137
138
144 };