# HG changeset patch # User reimar # Date 1299328035 0 # Node ID e3dfc7e2b0f82d3132066a0d94ac398f43c42b58 # Parent 4c49c83f2af7dfb8ea7f366788ace569d6654d6e Fix dnet decoding with -ac ffac3, the data needs to be byte-swapped. diff -r 4c49c83f2af7 -r e3dfc7e2b0f8 libmpcodecs/ad_ffmpeg.c --- a/libmpcodecs/ad_ffmpeg.c Sat Mar 05 12:24:33 2011 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Sat Mar 05 12:27:15 2011 +0000 @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define _XOPEN_SOURCE 600 #include #include #include @@ -220,6 +221,10 @@ int consumed = ds_parse(sh_audio->ds, &start, &x, pts, 0); sh_audio->ds->buffer_pos -= in_size - consumed; } + if (((AVCodecContext *)sh_audio->context)->codec_id == CODEC_ID_AC3 && + sh_audio->format == MKTAG('d', 'n', 'e', 't')) + swab(start, start, x & ~1); + av_init_packet(&pkt); pkt.data = start; pkt.size = x;