1 /*
2 * LucasArts Smush demuxer
3 * Copyright (c) 2006 Cyril Zorin
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
26
32
34 {
40 }
41
42 return 0;
43 }
44
46 {
50 uint32_t magic, nframes,
size, subversion, i;
51 uint32_t
width = 0,
height = 0, got_audio = 0, read = 0;
53
56
57 if (magic ==
MKBETAG(
'A',
'N',
'I',
'M')) {
60
62 if (size < 3 * 256 + 6)
64
68
70
71 for (i = 0; i < 256; i++)
73
75 }
else if (magic ==
MKBETAG(
'S',
'A',
'N',
'M') ) {
78
80 if (size < 14)
82
91
94
96 while (!got_audio && ((read + 8) < size)) {
97 uint32_t sig, chunk_size;
98
101
104 read += 8;
105 switch (sig) {
106 case MKBETAG(
'W',
'a',
'v',
'e'):
107 got_audio = 1;
111 read += chunk_size;
112 break;
113 case MKBETAG(
'B',
'l',
'1',
'6'):
114 case MKBETAG(
'A',
'N',
'N',
'O'):
116 read += chunk_size;
117 break;
118 default:
120 break;
121 }
122 }
123
125 } else {
128 }
129
131 if (!vst)
133
135
144
146
150
152 for (i = 0; i < 256; i++)
154 }
155
156 if (got_audio) {
158 if (!ast)
160
162
169
171 }
172
173 return 0;
174 }
175
177 {
180 int done = 0;
181
182 while (!done) {
184
187
190
191 switch (sig) {
192 case MKBETAG(
'F',
'R',
'M',
'E'):
194 break;
197
199 done = 1;
200 break;
201 case MKBETAG(
'B',
'l',
'1',
'6'):
204
207 done = 1;
208 break;
209 case MKBETAG(
'W',
'a',
'v',
'e'):
210 if (size < 13)
214
220 done = 1;
221 break;
222 default:
224 break;
225 }
226 }
227
228 return 0;
229 }
230
238 };