1 /*
2 * Raw TAK demuxer
3 * Copyright (c) 2012 Paul B Mahol
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
29
34
36 {
37 if (!memcmp(p->
buf,
"tBaK", 4))
39 return 0;
40 }
41
44 {
46 }
47
49 {
56
58 if (!st)
60
64
68 return 0;
69 }
70
74
77
78 switch (type) {
82 if (size <= 3)
84
86 if (!buffer)
89
91 if (
avio_read(pb, buffer, size - 3) != size - 3) {
94 }
100 }
101 }
102
104 break;
107 int i;
108
109 if (size != 19)
117 }
118
120 for (i = 0; i < 16; i++)
123 break;
124 }
127
131 }
132
134 return 0;
135 }
136 default:
138 if (ret < 0)
140 }
141
144
159 if (size != 11)
169 }
170 }
171
173 }
174
176 {
179
183
185 size =
FFMIN(left, 1024);
186 if (size <= 0)
188
190 if (ret < 0)
192
194 } else {
196 }
197
199 }
200
209 .extensions = "tak",
211 };