1 /*
2 * Copyright (c) 2006 Aurelien Jacobs <aurel@gnuage.org>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
25
26 int
28 {
29 VocDecContext *voc =
s->priv_data;
33 int size, tmp_codec=-1;
38
41 voc->pts,
42 voc->remaining_size,
43 0,
45
46 while (!voc->remaining_size) {
47 if (max_size < 4)
48 max_size = 0;
53 if (!voc->remaining_size) {
54 int64_t filesize;
60 voc->remaining_size = filesize -
avio_tell(pb);
61 }
62 max_size -= 4;
63
66 if (voc->remaining_size < 2) {
67 voc->remaining_size = 0;
69 }
77 } else
80 voc->remaining_size -= 2;
81 max_size -= 2;
83 break;
84
86 break;
87
93 voc->remaining_size = 0;
94 max_size -= 4;
95 break;
96
98 if (voc->remaining_size < 12) {
99 voc->remaining_size = 0;
101 }
108 } else
112 voc->remaining_size -= 12;
113 max_size -= 12;
114 break;
115
116 default:
118 max_size -= voc->remaining_size;
119 voc->remaining_size = 0;
120 break;
121 }
122 }
123
127 }
128
129 if (tmp_codec >= 0) {
133 else if (par->
codec_id != tmp_codec)
139 }
141 }
142 }
143
145
147 max_size = 2048;
148 size =
FFMIN(voc->remaining_size, max_size);
149 voc->remaining_size -=
size;
150
153
157 else
159
161 }