|
|
@ -122,14 +122,16 @@ static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt) |
|
|
|
IEC61937Context *ctx = s->priv_data; |
|
|
|
IEC61937Context *ctx = s->priv_data; |
|
|
|
static const uint8_t eac3_repeat[4] = {6, 3, 2, 1}; |
|
|
|
static const uint8_t eac3_repeat[4] = {6, 3, 2, 1}; |
|
|
|
int repeat = 1; |
|
|
|
int repeat = 1; |
|
|
|
|
|
|
|
uint8_t *tmp; |
|
|
|
|
|
|
|
|
|
|
|
int bsid = pkt->data[5] >> 3; |
|
|
|
int bsid = pkt->data[5] >> 3; |
|
|
|
if (bsid > 10 && (pkt->data[4] & 0xc0) != 0xc0) /* fscod */ |
|
|
|
if (bsid > 10 && (pkt->data[4] & 0xc0) != 0xc0) /* fscod */ |
|
|
|
repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */ |
|
|
|
repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */ |
|
|
|
|
|
|
|
|
|
|
|
ctx->hd_buf[0] = av_fast_realloc(ctx->hd_buf[0], &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size); |
|
|
|
tmp = av_fast_realloc(ctx->hd_buf[0], &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size); |
|
|
|
if (!ctx->hd_buf[0]) |
|
|
|
if (!tmp) |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
|
|
|
|
ctx->hd_buf[0] = tmp; |
|
|
|
|
|
|
|
|
|
|
|
memcpy(&ctx->hd_buf[0][ctx->hd_buf_filled], pkt->data, pkt->size); |
|
|
|
memcpy(&ctx->hd_buf[0][ctx->hd_buf_filled], pkt->data, pkt->size); |
|
|
|
|
|
|
|
|
|
|
|