1 /*
2 * THP Demuxer
3 * Copyright (c) 2007 Marco Gerards
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
46
47
49 {
50 /* check file header */
53 else
54 return 0;
55 }
56
58 {
63 int i;
64
65 /* Read the file header. */
68
71
76 if(fsize>0 && (!pb->
maxsize || fsize < pb->maxsize))
78
83
86
87 /* Read the component structure. */
90
91 /* Read the list of component types. */
93
97 break;
98
99 /* Video component. */
101 if (!st)
103
104 /* The denominator and numerator are switched because 1/fps
105 is required. */
117
122 break;
123
124 /* Audio component. */
126 if (!st)
128
134
136
139 }
140 }
141
142 return 0;
143 }
144
147 {
152
154 /* Terminate when last frame is reached. */
157
159
160 /* Locate the next frame and read out its size. */
163
164 avio_rb32(pb);
/* Previous total size. */
165 size =
avio_rb32(pb);
/* Total size of this frame. */
166
167 /* Store the audiosize so the next time this function is called,
168 the audio can be read. */
171 else
173
175 if (ret != size) {
178 }
179
181 } else {
186 }
187
191
194 }
195
196 return 0;
197 }
198
206 };