Skip to content

Commit

Permalink
libavformat: backport upstream fix for DTS-HD passthrough
Browse files Browse the repository at this point in the history
"Align IEC 61937 length_code for DTS-HD so that
(length_code & 0xf) == 0x8. This is reportedly needed with some
receivers."

SHA1: ab9c00b

Thanks to Anssi Hannula for the fix and pointing it out to me.
  • Loading branch information
tralph authored and jyavenard committed Nov 16, 2011
1 parent 32952c9 commit d05692c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mythtv/external/FFmpeg/libavformat/spdifenc.c
Expand Up @@ -214,7 +214,10 @@ static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size,
}

ctx->out_bytes = sizeof(dtshd_start_code) + 2 + pkt_size;
ctx->length_code = ctx->out_bytes;

/* Align so that (length_code & 0xf) == 0x8. This is reportedly needed
* with some receivers, but the exact requirement is unconfirmed. */
ctx->length_code = FFALIGN(ctx->out_bytes + 0x8, 0x10) - 0x8;

av_fast_malloc(&ctx->hd_buf, &ctx->hd_buf_size, ctx->out_bytes);
if (!ctx->hd_buf)
Expand Down

0 comments on commit d05692c

Please sign in to comment.