1 /*
2 * Creative Voice File demuxer.
3 * Copyright (c) 2006 Aurelien Jacobs <aurel@gnuage.org>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
25
26
28 {
30
32 return 0;
35 if (~version + 0x1234 != check)
36 return 10;
37
39 }
40
42 {
45 int header_size;
47
50 if (header_size != 4) {
53 }
56 if (!st)
59
61 return 0;
62 }
63
64 int
66 {
71 int size, tmp_codec=-1;
73 int channels = 1;
74
84 }
85 max_size -= 4;
86
87 switch (type) {
91 if (sample_rate)
94 } else
100 max_size -= 2;
101 channels = 1;
102 break;
103
105 break;
106
111 sample_rate = 256000000 / (channels * (65536 -
sample_rate));
113 max_size -= 4;
114 break;
115
120 } else
127 max_size -= 12;
128 break;
129
130 default:
134 break;
135 }
136 }
137
138 if (tmp_codec >= 0) {
142 else if (dec->
codec_id != tmp_codec)
148 }
150 }
151 }
152
154
155 if (max_size <= 0)
156 max_size = 2048;
160 }
161
163 {
165 }
166
175 };