[MPlayer-cvslog] r30170 - trunk/libaf/af_format.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 10 22:16:54 CET 2010


On Sun, Jan 10, 2010 at 03:42:20PM -0500, compn wrote:
> On Sat,  2 Jan 2010 21:45:27 +0100 (CET), reimar wrote:
> >Author: reimar
> >Date: Sat Jan  2 21:45:27 2010
> >New Revision: 30170
> >
> >Log:
> >Mark AC3 as 16-bit format, this simplifies alignment calculation and fixes
> >hwac3 with ALSA reportedly broken by r29750.
> 
> [15:38] <bamiaux> btw r 30170 also broke hwac3 with coreaudio
> [15:39] <bamiaux> I only hear random noise
> [15:40] <bamiaux> imo, alsa should be fixed, af_format.h before the
> change was cleaner

Before AC3 was implicitly AF_FORMAT_8BIT, so no, I can not at all agree
that it was cleaner.
Looking at the hwac3 code should show clearly that SPDIF AC3 is a format
with a 16-bit "base size".
Please try this change, but if it helps I think they did something really stupid...
Oh, and please try what happes if you set mBitsPerChannel to 0, because
contrary to 8 that would make at least some sense (though it might all
be due to the rather bogus ao->packetSize = inDesc.mBytesPerPacket = inDesc.mBytesPerFrame
calculation ao_coreaudio uses)...
Index: libao2/ao_coreaudio.c
===================================================================
--- libao2/ao_coreaudio.c	(revision 30258)
+++ libao2/ao_coreaudio.c	(working copy)
@@ -349,6 +349,8 @@
 #if HAVE_BIGENDIAN
         inDesc.mFormatFlags |= kAudioFormatFlagIsBigEndian;
 #endif
+        // For some reason we only get noise if the set mBitsPerChannel to 16 for AC3
+        inDesc.mBitsPerChannel=8;
     }
     else if ((format & AF_FORMAT_END_MASK) == AF_FORMAT_BE)
         inDesc.mFormatFlags |= kAudioFormatFlagIsBigEndian;



More information about the MPlayer-cvslog mailing list