"spdifenc: IEC 61937 encapsulation of DTS-HD for HDMI"
Janne Grunau authored on 2011/02/14 01:18:07... | ... |
@@ -142,24 +142,15 @@ static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt) |
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,7 +203,8 @@ static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size, |
212 | 212 |
if (ctx->dtshd_fallback > 0) |
213 | 213 |
ctx->dtshd_skip = sample_rate * ctx->dtshd_fallback / (blocks << 5); |
214 | 214 |
else |
215 |
- /* skip permanently (-1) or just once (0) */ |
|
215 |
+ /* skip permanently (dtshd_fallback == -1) or just once |
|
216 |
+ * (dtshd_fallback == 0) */ |
|
216 | 217 |
ctx->dtshd_skip = 1; |
217 | 218 |
} |
218 | 219 |
if (ctx->dtshd_skip && core_size) { |
... | ... |
@@ -224,8 +216,7 @@ static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size, |
224 | 224 |
ctx->out_bytes = sizeof(dtshd_start_code) + 2 + pkt_size; |
225 | 225 |
ctx->length_code = ctx->out_bytes; |
226 | 226 |
|
227 |
- ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, |
|
228 |
- ctx->out_bytes); |
|
227 |
+ av_fast_malloc(&ctx->hd_buf, &ctx->hd_buf_size, ctx->out_bytes); |
|
229 | 228 |
if (!ctx->hd_buf) |
230 | 229 |
return AVERROR(ENOMEM); |
231 | 230 |
|