Revision fabb93e3 libavformat/spdifenc.c
libavformat/spdifenc.c | ||
---|---|---|
142 | 142 |
* the outputted IEC 61937 stream is higher. |
143 | 143 |
* The repetition period is measured in IEC 60958 frames (4 bytes). |
144 | 144 |
*/ |
145 |
enum { |
|
146 |
DTS4_REP_PER_512 = 0x0, |
|
147 |
DTS4_REP_PER_1024 = 0x1, |
|
148 |
DTS4_REP_PER_2048 = 0x2, |
|
149 |
DTS4_REP_PER_4096 = 0x3, |
|
150 |
DTS4_REP_PER_8192 = 0x4, |
|
151 |
DTS4_REP_PER_16384 = 0x5, |
|
152 |
}; |
|
153 |
|
|
154 | 145 |
static int spdif_dts4_subtype(int period) |
155 | 146 |
{ |
156 | 147 |
switch (period) { |
157 |
case 512: return DTS4_REP_PER_512;
|
|
158 |
case 1024: return DTS4_REP_PER_1024;
|
|
159 |
case 2048: return DTS4_REP_PER_2048;
|
|
160 |
case 4096: return DTS4_REP_PER_4096;
|
|
161 |
case 8192: return DTS4_REP_PER_8192;
|
|
162 |
case 16384: return DTS4_REP_PER_16384;
|
|
148 |
case 512: return 0x0;
|
|
149 |
case 1024: return 0x1;
|
|
150 |
case 2048: return 0x2;
|
|
151 |
case 4096: return 0x3;
|
|
152 |
case 8192: return 0x4;
|
|
153 |
case 16384: return 0x5;
|
|
163 | 154 |
} |
164 | 155 |
return -1; |
165 | 156 |
} |
... | ... | |
212 | 203 |
if (ctx->dtshd_fallback > 0) |
213 | 204 |
ctx->dtshd_skip = sample_rate * ctx->dtshd_fallback / (blocks << 5); |
214 | 205 |
else |
215 |
/* skip permanently (-1) or just once (0) */ |
|
206 |
/* skip permanently (dtshd_fallback == -1) or just once |
|
207 |
* (dtshd_fallback == 0) */ |
|
216 | 208 |
ctx->dtshd_skip = 1; |
217 | 209 |
} |
218 | 210 |
if (ctx->dtshd_skip && core_size) { |
... | ... | |
224 | 216 |
ctx->out_bytes = sizeof(dtshd_start_code) + 2 + pkt_size; |
225 | 217 |
ctx->length_code = ctx->out_bytes; |
226 | 218 |
|
227 |
ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, |
|
228 |
ctx->out_bytes); |
|
219 |
av_fast_malloc(&ctx->hd_buf, &ctx->hd_buf_size, ctx->out_bytes); |
|
229 | 220 |
if (!ctx->hd_buf) |
230 | 221 |
return AVERROR(ENOMEM); |
231 | 222 |
|
Also available in: Unified diff